<!--
 * @Descripttion: 
 * @version: 
 * @Author: 王政乔(https://www.zhengqiao.wang/)
 * @Date: 2020-03-25 10:59:52
 * @LastEditors: 王政乔(https://www.zhengqiao.wang/)
 * @LastEditTime: 2020-04-12 19:47:37
 -->
<!DOCTYPE html>
<html  lang="zh">
<head>
    
    <link href="//cdn.bootcss.com/pace/1.0.2/themes/pink/pace-theme-flash.css" rel="stylesheet">

    <style>
        body {
            cursor: url("http://pic.zhengqiao.wang/Arrow.cur"), auto !important;
        }
    
        a:hover {
            cursor: url("http://pic.zhengqiao.wang/Hand.cur"), auto !important;
        }
        input:hover{
            cursor: url("http://pic.zhengqiao.wang/IBeam.cur"), auto !important;
        }
        .pace .pace-progress {
            background: #1E92FB; /*进度条颜色*/
            height: 3px;
        }
        .pace .pace-progress-inner {
            box-shadow: 0 0 10px #1E92FB, 0 0 5px     #1E92FB; /*阴影颜色*/
        }
        .pace .pace-activity {
            border-top-color: #1E92FB;    /*上边框颜色*/
            border-left-color: #1E92FB;    /*左边框颜色*/
        }
    </style>
    <!--
 * @Descripttion: 
 * @version: 
 * @Author: 王政乔(https://www.zhengqiao.wang/)
 * @Date: 2020-03-25 10:59:52
 * @LastEditors: 王政乔(https://www.zhengqiao.wang/)
 * @LastEditTime: 2020-05-06 19:55:13
 -->
<meta charset="utf-8" />

<meta name="generator" content="Hexo 4.2.0" />

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

<title>编译原理实验二：预测分析算法的设计与实现（最终） - 王政乔|中国</title>
<!-- iconfont -->
<link rel="stylesheet" href="//at.alicdn.com/t/font_1734413_xyuugyshzlp.css">

    <meta name="description" content="编译原理实验二：预测分析算法的设计与实现人生苦短，我用python。虽然代码量比起那些大佬们的c语言还是多了些，但起码….意料之外的bug就少了很多。 我把功能封装到类中，这次代码是我注释最多的一次，要不根本没办法修改，毕竟python的可维护性之差是有目共睹的。 TM终于写完了，我已经忍不住爆粗口了 去它的编译原理！！！！！！ 直接放源码～(里面有部分实验三的代码，请自行删减)">
<meta property="og:type" content="article">
<meta property="og:title" content="编译原理实验二：预测分析算法的设计与实现（最终）">
<meta property="og:url" content="https://www.zhengqiao.wang/2018-11-15-%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%AE%9E%E9%AA%8C%E4%BA%8C%E9%A2%84%E6%B5%8B%E5%88%86%E6%9E%90%E7%AE%97%E6%B3%95%E7%9A%84%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%AE%9E%E7%8E%B0/index.html">
<meta property="og:site_name" content="王政乔|中国">
<meta property="og:description" content="编译原理实验二：预测分析算法的设计与实现人生苦短，我用python。虽然代码量比起那些大佬们的c语言还是多了些，但起码….意料之外的bug就少了很多。 我把功能封装到类中，这次代码是我注释最多的一次，要不根本没办法修改，毕竟python的可维护性之差是有目共睹的。 TM终于写完了，我已经忍不住爆粗口了 去它的编译原理！！！！！！ 直接放源码～(里面有部分实验三的代码，请自行删减)">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://www.zhengqiao.wang/images/og_image.png">
<meta property="article:published_time" content="2018-11-27T16:00:00.000Z">
<meta property="article:modified_time" content="2020-03-31T12:17:11.167Z">
<meta property="article:author" content="王政乔">
<meta property="article:tag" content="python">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://www.zhengqiao.wang/images/og_image.png">







<link rel="icon" href="http://pic.zhengqiao.wang/20200301103642.jpg">


<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.7.2/css/bulma.css">

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,600|Source+Code+Pro">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@9.12.0/styles/atom-one-light.css">


    
    
<style>body>.footer,body>.navbar,body>.section{opacity:0}</style>

    
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/css/lightgallery.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/css/justifiedGallery.min.css">

    
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.css">

    
    
    
    
<link rel="stylesheet" href="/css/back-to-top.css">

    
    
    
    <script>
var _hmt = _hmt || [];
(function() {
    var hm = document.createElement("script");
    hm.src = "//hm.baidu.com/hm.js?c62b048aa4e4e717dbea80aaaab32c9e";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();
</script>
    
    
    
    <link rel="stylesheet" href="/css/progressbar.css">
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>
    
    
    


<link rel="stylesheet" href="/css/style.css">
</head>
<body class="is-3-column">
    <script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
    
        <canvas class="fireworks" style="position: fixed;left: 0;top: 0;z-index: 1; pointer-events: none;"></canvas>
        <script type="text/javascript" src="//cdn.bootcss.com/animejs/2.2.0/anime.min.js"></script>
        <script type="text/javascript" src="/js/fireworks.js"></script>
    
    <!--
 * @Descripttion: 
 * @version: 
 * @Author: 王政乔(https://www.zhengqiao.wang/)
 * @Date: 2020-03-25 10:59:52
 * @LastEditors: 王政乔(https://www.zhengqiao.wang/)
 * @LastEditTime: 2020-04-04 10:57:37
 -->
<nav class="navbar navbar-main">
    <div class="container">
        <div class="navbar-brand is-flex-center">
            <a class="navbar-item navbar-logo" href="/">
            
                王政乔|中国
            
            </a>
        </div>
        <div class="navbar-menu">
            
            <div class="navbar-start">
                
                <a class="navbar-item"
                href="/">主页</a>
                
                <a class="navbar-item"
                href="/archives">文章列表</a>
                
                <a class="navbar-item"
                href="/about">关于我</a>
                
                <a class="navbar-item"
                href="/gallary">图集</a>
                
                <a class="navbar-item"
                href="/jogertools">政乔工具库</a>
                
            </div>
            
            <div class="navbar-end">
                
                    
                    <a class="navbar-item" target="_blank" rel="noopener" title="访问我的Gitee" href="https://gitee.com/JogerQiao">
                        
                        <i class="iconfont icon-gitee-fill-round"></i>
                        
                    </a>
                    
                    <a class="navbar-item" target="_blank" rel="noopener" title="我的邮箱" href="mailto:me@zhengqiao.wang">
                        
                        <i class="iconfont icon-mail"></i>
                        
                    </a>
                    
                    <a class="navbar-item" target="_blank" rel="noopener" title="Bilibili" href="https://space.bilibili.com/83542572">
                        
                        <i class="iconfont icon-bilibili-line"></i>
                        
                    </a>
                    
                    <a class="navbar-item" target="_blank" rel="noopener" title="知乎" href="https://www.zhihu.com/people/joger-81">
                        
                        <i class="iconfont icon-zhihu"></i>
                        
                    </a>
                    
                
                
                <a class="navbar-item is-hidden-tablet catalogue" title="目录" href="javascript:;">
                    <i class="fas fa-list-ul"></i>
                </a>
                
                
                <a class="navbar-item search" title="搜索" href="javascript:;">
                    <i class="iconfont icon-search"></i>
                </a>
                
            </div>
        </div>
    </div>
</nav>
    
    <section class="section">
        <div class="container">
            <div class="columns">
                <div class="column is-8-tablet is-8-desktop is-6-widescreen has-order-2 column-main">
<div class="card">
    
    <div class="card-content article ">
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2018-11-27T16:00:00.000Z">2018年11月28日</time>
                
                <div class="level-item">
                <a class="has-link-grey -link" href="/categories/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/">课程设计</a>&nbsp;/&nbsp;<a class="has-link-grey -link" href="/categories/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86/">编译原理</a>
                </div>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    28 分钟 读完 (大约 4144 个字)
                </span>
                
                
            </div>
        </div>
        
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                编译原理实验二：预测分析算法的设计与实现（最终）
            
        </h1>
        <div class="content">
            <h2 id="编译原理实验二：预测分析算法的设计与实现"><a href="#编译原理实验二：预测分析算法的设计与实现" class="headerlink" title="编译原理实验二：预测分析算法的设计与实现"></a>编译原理实验二：预测分析算法的设计与实现</h2><p>人生苦短，我用python。虽然代码量比起那些大佬们的c语言还是多了些，但起码….意料之外的bug就少了很多。</p>
<p>我把功能封装到类中，这次代码是我注释最多的一次，要不根本没办法修改，毕竟python的可维护性之差是有目共睹的。</p>
<p>TM终于写完了，我已经忍不住爆粗口了</p>
<p>去它的编译原理！！！！！！</p>
<p>直接放源码～(里面有部分实验三的代码，请自行删减)</p>
<a id="more"></a>

<p>tc2.py</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br><span class="line">326</span><br><span class="line">327</span><br><span class="line">328</span><br><span class="line">329</span><br><span class="line">330</span><br><span class="line">331</span><br><span class="line">332</span><br><span class="line">333</span><br><span class="line">334</span><br><span class="line">335</span><br><span class="line">336</span><br><span class="line">337</span><br><span class="line">338</span><br><span class="line">339</span><br><span class="line">340</span><br><span class="line">341</span><br><span class="line">342</span><br><span class="line">343</span><br><span class="line">344</span><br><span class="line">345</span><br><span class="line">346</span><br><span class="line">347</span><br><span class="line">348</span><br><span class="line">349</span><br><span class="line">350</span><br><span class="line">351</span><br><span class="line">352</span><br><span class="line">353</span><br><span class="line">354</span><br><span class="line">355</span><br><span class="line">356</span><br><span class="line">357</span><br><span class="line">358</span><br><span class="line">359</span><br><span class="line">360</span><br><span class="line">361</span><br><span class="line">362</span><br><span class="line">363</span><br><span class="line">364</span><br><span class="line">365</span><br><span class="line">366</span><br><span class="line">367</span><br><span class="line">368</span><br><span class="line">369</span><br><span class="line">370</span><br><span class="line">371</span><br><span class="line">372</span><br><span class="line">373</span><br><span class="line">374</span><br><span class="line">375</span><br><span class="line">376</span><br><span class="line">377</span><br><span class="line">378</span><br><span class="line">379</span><br><span class="line">380</span><br><span class="line">381</span><br><span class="line">382</span><br><span class="line">383</span><br><span class="line">384</span><br><span class="line">385</span><br><span class="line">386</span><br><span class="line">387</span><br><span class="line">388</span><br><span class="line">389</span><br><span class="line">390</span><br><span class="line">391</span><br><span class="line">392</span><br><span class="line">393</span><br><span class="line">394</span><br><span class="line">395</span><br><span class="line">396</span><br><span class="line">397</span><br><span class="line">398</span><br><span class="line">399</span><br><span class="line">400</span><br><span class="line">401</span><br><span class="line">402</span><br><span class="line">403</span><br><span class="line">404</span><br><span class="line">405</span><br><span class="line">406</span><br><span class="line">407</span><br><span class="line">408</span><br><span class="line">409</span><br><span class="line">410</span><br><span class="line">411</span><br><span class="line">412</span><br><span class="line">413</span><br><span class="line">414</span><br><span class="line">415</span><br><span class="line">416</span><br><span class="line">417</span><br><span class="line">418</span><br><span class="line">419</span><br><span class="line">420</span><br><span class="line">421</span><br><span class="line">422</span><br><span class="line">423</span><br><span class="line">424</span><br><span class="line">425</span><br><span class="line">426</span><br><span class="line">427</span><br><span class="line">428</span><br><span class="line">429</span><br><span class="line">430</span><br><span class="line">431</span><br><span class="line">432</span><br><span class="line">433</span><br><span class="line">434</span><br><span class="line">435</span><br><span class="line">436</span><br><span class="line">437</span><br><span class="line">438</span><br><span class="line">439</span><br><span class="line">440</span><br><span class="line">441</span><br><span class="line">442</span><br><span class="line">443</span><br><span class="line">444</span><br><span class="line">445</span><br><span class="line">446</span><br><span class="line">447</span><br><span class="line">448</span><br><span class="line">449</span><br><span class="line">450</span><br><span class="line">451</span><br><span class="line">452</span><br><span class="line">453</span><br><span class="line">454</span><br><span class="line">455</span><br><span class="line">456</span><br><span class="line">457</span><br><span class="line">458</span><br><span class="line">459</span><br><span class="line">460</span><br><span class="line">461</span><br><span class="line">462</span><br><span class="line">463</span><br><span class="line">464</span><br><span class="line">465</span><br><span class="line">466</span><br><span class="line">467</span><br><span class="line">468</span><br><span class="line">469</span><br><span class="line">470</span><br><span class="line">471</span><br><span class="line">472</span><br><span class="line">473</span><br><span class="line">474</span><br><span class="line">475</span><br><span class="line">476</span><br><span class="line">477</span><br><span class="line">478</span><br><span class="line">479</span><br><span class="line">480</span><br><span class="line">481</span><br><span class="line">482</span><br><span class="line">483</span><br><span class="line">484</span><br><span class="line">485</span><br><span class="line">486</span><br><span class="line">487</span><br><span class="line">488</span><br><span class="line">489</span><br><span class="line">490</span><br><span class="line">491</span><br><span class="line">492</span><br><span class="line">493</span><br><span class="line">494</span><br><span class="line">495</span><br><span class="line">496</span><br><span class="line">497</span><br><span class="line">498</span><br><span class="line">499</span><br><span class="line">500</span><br><span class="line">501</span><br><span class="line">502</span><br><span class="line">503</span><br><span class="line">504</span><br><span class="line">505</span><br><span class="line">506</span><br><span class="line">507</span><br><span class="line">508</span><br><span class="line">509</span><br><span class="line">510</span><br><span class="line">511</span><br><span class="line">512</span><br><span class="line">513</span><br><span class="line">514</span><br><span class="line">515</span><br><span class="line">516</span><br><span class="line">517</span><br><span class="line">518</span><br><span class="line">519</span><br><span class="line">520</span><br><span class="line">521</span><br><span class="line">522</span><br><span class="line">523</span><br><span class="line">524</span><br><span class="line">525</span><br><span class="line">526</span><br><span class="line">527</span><br><span class="line">528</span><br><span class="line">529</span><br><span class="line">530</span><br><span class="line">531</span><br><span class="line">532</span><br><span class="line">533</span><br><span class="line">534</span><br><span class="line">535</span><br><span class="line">536</span><br><span class="line">537</span><br><span class="line">538</span><br><span class="line">539</span><br><span class="line">540</span><br><span class="line">541</span><br><span class="line">542</span><br><span class="line">543</span><br><span class="line">544</span><br><span class="line">545</span><br><span class="line">546</span><br><span class="line">547</span><br><span class="line">548</span><br><span class="line">549</span><br><span class="line">550</span><br><span class="line">551</span><br><span class="line">552</span><br><span class="line">553</span><br><span class="line">554</span><br><span class="line">555</span><br><span class="line">556</span><br><span class="line">557</span><br><span class="line">558</span><br><span class="line">559</span><br><span class="line">560</span><br><span class="line">561</span><br><span class="line">562</span><br><span class="line">563</span><br><span class="line">564</span><br><span class="line">565</span><br><span class="line">566</span><br><span class="line">567</span><br><span class="line">568</span><br><span class="line">569</span><br><span class="line">570</span><br><span class="line">571</span><br><span class="line">572</span><br><span class="line">573</span><br><span class="line">574</span><br><span class="line">575</span><br><span class="line">576</span><br><span class="line">577</span><br><span class="line">578</span><br><span class="line">579</span><br><span class="line">580</span><br><span class="line">581</span><br><span class="line">582</span><br><span class="line">583</span><br><span class="line">584</span><br><span class="line">585</span><br><span class="line">586</span><br><span class="line">587</span><br><span class="line">588</span><br><span class="line">589</span><br><span class="line">590</span><br><span class="line">591</span><br><span class="line">592</span><br><span class="line">593</span><br><span class="line">594</span><br><span class="line">595</span><br><span class="line">596</span><br><span class="line">597</span><br><span class="line">598</span><br><span class="line">599</span><br><span class="line">600</span><br><span class="line">601</span><br><span class="line">602</span><br><span class="line">603</span><br><span class="line">604</span><br><span class="line">605</span><br><span class="line">606</span><br><span class="line">607</span><br><span class="line">608</span><br><span class="line">609</span><br><span class="line">610</span><br><span class="line">611</span><br><span class="line">612</span><br><span class="line">613</span><br><span class="line">614</span><br><span class="line">615</span><br><span class="line">616</span><br><span class="line">617</span><br><span class="line">618</span><br><span class="line">619</span><br><span class="line">620</span><br><span class="line">621</span><br><span class="line">622</span><br><span class="line">623</span><br><span class="line">624</span><br><span class="line">625</span><br><span class="line">626</span><br><span class="line">627</span><br><span class="line">628</span><br><span class="line">629</span><br><span class="line">630</span><br><span class="line">631</span><br><span class="line">632</span><br><span class="line">633</span><br><span class="line">634</span><br><span class="line">635</span><br><span class="line">636</span><br><span class="line">637</span><br><span class="line">638</span><br><span class="line">639</span><br><span class="line">640</span><br><span class="line">641</span><br><span class="line">642</span><br><span class="line">643</span><br><span class="line">644</span><br><span class="line">645</span><br><span class="line">646</span><br><span class="line">647</span><br><span class="line">648</span><br><span class="line">649</span><br><span class="line">650</span><br><span class="line">651</span><br><span class="line">652</span><br><span class="line">653</span><br><span class="line">654</span><br><span class="line">655</span><br><span class="line">656</span><br><span class="line">657</span><br><span class="line">658</span><br><span class="line">659</span><br><span class="line">660</span><br><span class="line">661</span><br><span class="line">662</span><br><span class="line">663</span><br><span class="line">664</span><br><span class="line">665</span><br><span class="line">666</span><br><span class="line">667</span><br><span class="line">668</span><br><span class="line">669</span><br><span class="line">670</span><br><span class="line">671</span><br><span class="line">672</span><br><span class="line">673</span><br><span class="line">674</span><br><span class="line">675</span><br><span class="line">676</span><br><span class="line">677</span><br><span class="line">678</span><br><span class="line">679</span><br><span class="line">680</span><br><span class="line">681</span><br><span class="line">682</span><br><span class="line">683</span><br><span class="line">684</span><br><span class="line">685</span><br><span class="line">686</span><br><span class="line">687</span><br><span class="line">688</span><br><span class="line">689</span><br><span class="line">690</span><br><span class="line">691</span><br><span class="line">692</span><br><span class="line">693</span><br><span class="line">694</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#!/usr/bin/python</span></span><br><span class="line"><span class="comment"># -*- coding: UTF-8 -*-</span></span><br><span class="line"><span class="keyword">import</span> prettytable <span class="keyword">as</span> pt</span><br><span class="line"><span class="keyword">import</span> sys</span><br><span class="line"><span class="keyword">import</span> string</span><br><span class="line"><span class="keyword">import</span> numpy</span><br><span class="line"><span class="keyword">import</span> array</span><br><span class="line"><span class="keyword">import</span> re</span><br><span class="line"></span><br><span class="line">sys.setrecursionlimit(<span class="number">1000000</span>)</span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">tc2</span><span class="params">(object)</span>:</span></span><br><span class="line"></span><br><span class="line">    __dic_formula=&#123;&#125; <span class="comment">#产生式的字典</span></span><br><span class="line">    __terSymbol=[<span class="string">'#'</span>] <span class="comment">#终结符号</span></span><br><span class="line">    __non_ter=[] <span class="comment">#非终结符号</span></span><br><span class="line">    __firstSET=&#123;&#125; <span class="comment">#各产生式的first集合</span></span><br><span class="line">    __followSET=&#123;&#125; <span class="comment">#各产生式的follow集合</span></span><br><span class="line">    __firstVT=&#123;&#125; <span class="comment">#firstvt集合</span></span><br><span class="line">    __lastVT=&#123;&#125; <span class="comment">#lastvt集合</span></span><br><span class="line">    __startsign=<span class="string">''</span></span><br><span class="line">    __emptysign=<span class="string">'$'</span> <span class="comment">#设置空的标识符</span></span><br><span class="line">    __anatable=[]</span><br><span class="line">    tb=pt.PrettyTable()</span><br><span class="line">    __tablem=&#123;&#125; <span class="comment">#用于存放预测分析数据的字典，其结构是</span></span><br><span class="line">    <span class="comment"># __tablem=&#123;终结符:[[上级非终结符,产生式],[]]&#125;</span></span><br><span class="line">    incount=<span class="number">0</span></span><br><span class="line">    __readtxt=[]</span><br><span class="line">    __yxjtable=numpy.array([]) <span class="comment">#优先级表</span></span><br><span class="line">    __chuan=<span class="string">""</span> <span class="comment">#读取的文本</span></span><br><span class="line">    __intxt=<span class="string">""</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">__init__</span><span class="params">(self)</span>:</span></span><br><span class="line">        print(<span class="string">"-------实验二-预测分析算法的设计与实现---------"</span>)</span><br><span class="line">        print(<span class="string">"作者：王政乔 20160520126"</span>)</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">insert_wf</span><span class="params">(self,filepath)</span>:</span></span><br><span class="line">        <span class="comment">#输入文法</span></span><br><span class="line">        fileread=open(filepath,mode=<span class="string">'r'</span>)</span><br><span class="line">        filereadtxt=fileread.readlines()</span><br><span class="line">        <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">0</span>,len(filereadtxt)<span class="number">-1</span>):</span><br><span class="line">            filereadtxt[i]=filereadtxt[i].rstrip(<span class="string">'\n'</span>) <span class="comment">#去掉右侧的\n符号</span></span><br><span class="line">        print(<span class="string">"----文本内容----"</span>)</span><br><span class="line">        print(filereadtxt)</span><br><span class="line">        self.__readtxt=filereadtxt</span><br><span class="line">        self.__startsign=filereadtxt[<span class="number">0</span>][<span class="number">0</span>]</span><br><span class="line">        <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">0</span>,len(filereadtxt)):</span><br><span class="line">            flagindex=filereadtxt[i].find(<span class="string">"-&gt;"</span>) <span class="comment">#从左到右找到第一个-&gt;符号</span></span><br><span class="line">            <span class="keyword">if</span> flagindex&gt;<span class="number">3</span>:</span><br><span class="line">                <span class="comment">#-&gt;符号太靠右了，说明一定有问题</span></span><br><span class="line">                print(<span class="string">"格式错误"</span>)</span><br><span class="line">            <span class="comment">#开始进行分割操作</span></span><br><span class="line">            <span class="comment">#print(filereadtxt[i][flagindex+2:]) #这个是把左侧内容清除掉后的内容</span></span><br><span class="line">            strright=filereadtxt[i][flagindex+<span class="number">2</span>:]</span><br><span class="line">            tdf=[]</span><br><span class="line">            tdf=strright.split(<span class="string">'|'</span>)</span><br><span class="line">            <span class="comment">#print(tdf)</span></span><br><span class="line">            <span class="keyword">if</span> filereadtxt[i][flagindex<span class="number">-1</span>] <span class="keyword">in</span> self.__dic_formula:</span><br><span class="line">                <span class="comment">#如果产生式的字典里已经存在这个非终结符</span></span><br><span class="line">                self.__dic_formula[filereadtxt[i][flagindex<span class="number">-1</span>]]+=tdf</span><br><span class="line">                <span class="keyword">pass</span></span><br><span class="line">            <span class="keyword">else</span>:</span><br><span class="line">                <span class="comment">#这是一个全新的非终结符</span></span><br><span class="line">                self.__dic_formula[filereadtxt[i][flagindex<span class="number">-1</span>]]=tdf</span><br><span class="line">                self.__non_ter.append(filereadtxt[i][flagindex<span class="number">-1</span>])</span><br><span class="line">        print(self.__readtxt)</span><br><span class="line">        print(self.__dic_formula)</span><br><span class="line">        print(self.__non_ter)</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">getNotHave</span><span class="params">(self)</span>:</span></span><br><span class="line">        <span class="comment">#会从大写字母表中，找没有出现过的关键字并返回</span></span><br><span class="line">        <span class="keyword">for</span> i <span class="keyword">in</span> string.ascii_uppercase[:]:</span><br><span class="line">            <span class="keyword">if</span> i <span class="keyword">not</span> <span class="keyword">in</span> self.__dic_formula:</span><br><span class="line">                <span class="comment">#不存在这个非终结符</span></span><br><span class="line">                <span class="keyword">return</span> i</span><br><span class="line">        </span><br><span class="line">        <span class="keyword">return</span> <span class="string">'!'</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">switchleft2notleft</span><span class="params">(self)</span>:</span></span><br><span class="line">        <span class="comment">#消除左递归 间接</span></span><br><span class="line">        <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">0</span>,len(self.__non_ter)):</span><br><span class="line">            <span class="comment">#将非终结符依次遍历</span></span><br><span class="line">            <span class="keyword">for</span> j <span class="keyword">in</span> self.__dic_formula[self.__non_ter[i]]:</span><br><span class="line">                <span class="comment">#在产生式中进行遍历</span></span><br><span class="line">                <span class="keyword">if</span> j[<span class="number">0</span>] <span class="keyword">in</span> self.__non_ter:</span><br><span class="line">                    <span class="comment">#如果第一位是个非终结符</span></span><br><span class="line">                    <span class="keyword">if</span> self.__non_ter.index(j[<span class="number">0</span>])&gt;=i:</span><br><span class="line">                        <span class="comment">#2） 若产生式右部最左的符号是非终结符，且这个非终结符序号大于等于左部非终结符，则暂不处理（后面会处理到）</span></span><br><span class="line">                        <span class="keyword">pass</span></span><br><span class="line">                    <span class="keyword">else</span>:</span><br><span class="line">                        <span class="comment">#3） 若序号小于左部的非终结符，则用之前求到的式子的右部来替换</span></span><br><span class="line">                        <span class="keyword">for</span> temR <span class="keyword">in</span> self.__dic_formula[j[<span class="number">0</span>]]:</span><br><span class="line">                            self.__dic_formula[self.__non_ter[i]].append(temR+j[<span class="number">1</span>:])</span><br><span class="line">                            <span class="keyword">if</span> j <span class="keyword">in</span> self.__dic_formula[self.__non_ter[i]]:</span><br><span class="line">                                self.__dic_formula[self.__non_ter[i]].remove(j)</span><br><span class="line">                            <span class="comment">#self.__dic_formula[self.__non_ter[i]].remove(j)</span></span><br><span class="line">                            <span class="comment">#print("fff:"+temR+j[1:])</span></span><br><span class="line">        <span class="comment">#消除左递归 直接</span></span><br><span class="line">        </span><br><span class="line">        <span class="keyword">for</span> i <span class="keyword">in</span> list(self.__dic_formula.keys()):</span><br><span class="line">            <span class="comment">#对产生产生式遍历</span></span><br><span class="line">            <span class="keyword">for</span> j <span class="keyword">in</span> self.__dic_formula[i]:</span><br><span class="line">                <span class="keyword">if</span> j[<span class="number">0</span>]==i:</span><br><span class="line">                    <span class="comment">#如果是直接左递归</span></span><br><span class="line">                    temR=self.getNotHave() <span class="comment">#获取一个新的非终结符</span></span><br><span class="line">                    temRl=[]</span><br><span class="line">                    temRl.append(j[<span class="number">1</span>:]+temR)</span><br><span class="line">                    temRl.append(self.__emptysign) <span class="comment">#结尾添加空符号</span></span><br><span class="line">                    self.__non_ter.append(temR)</span><br><span class="line">                    self.__dic_formula[temR]=temRl</span><br><span class="line">                    <span class="comment">#print("----",self.__dic_formula[i])</span></span><br><span class="line">                    <span class="keyword">for</span> t <span class="keyword">in</span> range(<span class="number">0</span>, len(self.__dic_formula[i])):</span><br><span class="line">                        <span class="comment">#再遍历一次</span></span><br><span class="line">                        <span class="keyword">if</span> self.__dic_formula[i][t][<span class="number">0</span>]==i:</span><br><span class="line">                            self.__dic_formula[i][t]=self.__dic_formula[i][t][<span class="number">1</span>:] + temR</span><br><span class="line">                        <span class="keyword">else</span>:</span><br><span class="line">                            self.__dic_formula[i][t]=self.__dic_formula[i][t] + temR</span><br><span class="line">            self.__dic_formula[i]=list(set(self.__dic_formula[i]))</span><br><span class="line">        print(<span class="string">"经过消除左递归："</span> ,self.__dic_formula)</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">getfirst</span><span class="params">(self,instring=<span class="string">"nostring"</span>)</span>:</span> <span class="comment">#获得first集合</span></span><br><span class="line">        <span class="keyword">if</span> instring!=<span class="string">"nostring"</span>:</span><br><span class="line">            <span class="comment">#说明有字符串传入</span></span><br><span class="line">            print(<span class="string">"---字符串的first集合"</span>)</span><br><span class="line"></span><br><span class="line">        <span class="keyword">else</span>:</span><br><span class="line">            <span class="comment">#说明直接操作类中集合</span></span><br><span class="line">            print(<span class="string">"---类中产生式的first集合"</span>)</span><br><span class="line">            <span class="keyword">for</span> key <span class="keyword">in</span> self.__dic_formula:</span><br><span class="line">                <span class="comment">#遍历字典的索引</span></span><br><span class="line">                firstlist=[]</span><br><span class="line">                <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">0</span>,len(self.__dic_formula[key])):</span><br><span class="line">                    <span class="comment">#遍历字典存储的产生式</span></span><br><span class="line">                    j=<span class="number">0</span></span><br><span class="line">                    temps=self.__dic_formula[key][i]</span><br><span class="line">                    <span class="keyword">while</span>(temps[j] <span class="keyword">in</span> self.__non_ter):</span><br><span class="line">                        <span class="comment">#如果该字符是非终结符</span></span><br><span class="line">                        temps=self.__dic_formula[temps[j]][i]</span><br><span class="line">                    <span class="keyword">else</span>:</span><br><span class="line">                        <span class="comment">#如果该字符是终结符</span></span><br><span class="line">                        <span class="keyword">if</span>(temps[j] <span class="keyword">not</span> <span class="keyword">in</span> self.__terSymbol):</span><br><span class="line">                            <span class="comment">#如果这个终结符未被记录</span></span><br><span class="line">                            self.__terSymbol.append(temps[j])</span><br><span class="line">                        firstlist.append(temps[j])</span><br><span class="line">                self.__firstSET[key]=firstlist</span><br><span class="line">        print(self.__firstSET)</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">getsfirst_t</span><span class="params">(self,func=<span class="string">"1"</span>)</span>:</span></span><br><span class="line">        <span class="comment">#print("----first集合------")</span></span><br><span class="line">        <span class="keyword">if</span> func==<span class="string">"1"</span>: <span class="comment">#默认的是直接求first集合</span></span><br><span class="line">            <span class="keyword">for</span> key <span class="keyword">in</span> self.__dic_formula:</span><br><span class="line">                self.getsfirst_d(key,key)</span><br><span class="line">        </span><br><span class="line">        <span class="keyword">else</span>:</span><br><span class="line">            <span class="comment">#求字符串的集合</span></span><br><span class="line">            <span class="comment">#print("-----求字符串" + func + "的first集合")</span></span><br><span class="line">            <span class="keyword">if</span> func[<span class="number">0</span>] <span class="keyword">in</span> self.__non_ter:</span><br><span class="line">                <span class="comment">#第一位是非终结符</span></span><br><span class="line">                <span class="keyword">return</span> self.__firstSET[func[<span class="number">0</span>]]</span><br><span class="line">            <span class="keyword">else</span>:</span><br><span class="line">                tl=[]</span><br><span class="line">                tl.append(func[<span class="number">0</span>])</span><br><span class="line">                <span class="keyword">return</span> tl</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line"></span><br><span class="line">    firstl=[]</span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">getsfirst_d</span><span class="params">(self,valuekey,inkey)</span>:</span></span><br><span class="line">        <span class="comment">#自我递归</span></span><br><span class="line">        firstlist=[]</span><br><span class="line">        <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">0</span>,len(self.__dic_formula[inkey])): <span class="comment">#依次寻找first集合</span></span><br><span class="line">            <span class="comment">#print("digui " + str(self.incount))</span></span><br><span class="line">            self.incount+=<span class="number">1</span></span><br><span class="line"></span><br><span class="line">            temps=self.__dic_formula[inkey][i]</span><br><span class="line">            <span class="comment">#print(temps)</span></span><br><span class="line">            <span class="keyword">if</span>(temps[<span class="number">0</span>] <span class="keyword">in</span> self.__non_ter) <span class="keyword">and</span> self.incount&lt;<span class="number">9000</span> : <span class="comment">#首字母为非终结符</span></span><br><span class="line">                self.getsfirst_d(valuekey,temps[<span class="number">0</span>])</span><br><span class="line">            <span class="keyword">else</span>: <span class="comment">#首字母为终结符</span></span><br><span class="line">                <span class="comment">#self.firstl.append(temps[0])</span></span><br><span class="line">                <span class="keyword">if</span> valuekey <span class="keyword">in</span> self.__firstSET:</span><br><span class="line">                    firstlist=self.__firstSET[valuekey]</span><br><span class="line">                    <span class="comment">#print(firstlist)</span></span><br><span class="line">                <span class="keyword">if</span> temps[<span class="number">0</span>] <span class="keyword">not</span> <span class="keyword">in</span> firstlist:</span><br><span class="line">                    firstlist.append(temps[<span class="number">0</span>])</span><br><span class="line">                firstlist.sort()</span><br><span class="line">                self.__firstSET[valuekey]=firstlist</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">getsfollow_d</span><span class="params">(self)</span>:</span></span><br><span class="line">        <span class="comment">#求follow</span></span><br><span class="line">        follows=[]</span><br><span class="line">        follows.append(<span class="string">'#'</span>)</span><br><span class="line">        self.__followSET[self.__startsign]=follows</span><br><span class="line">        <span class="comment">#第一步</span></span><br><span class="line">        <span class="comment">#思路是第一次无所谓终结符非终结符，只要非空，那么就把它放到follow集合中。</span></span><br><span class="line">        <span class="comment">#然后对follow集合进行反复更改，清除集合里面的非终结符</span></span><br><span class="line">        <span class="keyword">for</span> key <span class="keyword">in</span> self.__dic_formula:</span><br><span class="line">            <span class="comment">#对产生式进行遍历</span></span><br><span class="line">            <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">0</span>,len(self.__dic_formula[key])):</span><br><span class="line">                <span class="comment">#遍历产生式里面的元素</span></span><br><span class="line">                <span class="keyword">for</span> j <span class="keyword">in</span> range(<span class="number">0</span>,len(self.__dic_formula[key][i])):</span><br><span class="line">                    <span class="comment">#遍历产生式里的元素的字符</span></span><br><span class="line">                    <span class="keyword">if</span> self.__dic_formula[key][i][j] <span class="keyword">in</span> self.__non_ter:</span><br><span class="line">                        <span class="comment">#如果发现字母是非终结符</span></span><br><span class="line">                        <span class="keyword">if</span> j!=len(self.__dic_formula[key][i])<span class="number">-1</span>:</span><br><span class="line">                            <span class="comment">#如果字母不是最后一位的</span></span><br><span class="line">                            follows=[] <span class="comment">#清空一下</span></span><br><span class="line">                            <span class="keyword">if</span> self.__dic_formula[key][i][j] <span class="keyword">in</span> self.__followSET:</span><br><span class="line">                                <span class="comment">#如果follow集合里存在这个非终结符</span></span><br><span class="line">                                follows=self.__followSET[self.__dic_formula[key][i][j]]</span><br><span class="line">                            <span class="keyword">if</span> self.__dic_formula[key][i][j+<span class="number">1</span>] <span class="keyword">in</span> self.__non_ter:</span><br><span class="line">                                <span class="comment">#如果这个非终结符的下一位还是非终结符（要求下一位的first集合了)</span></span><br><span class="line">                                follows+=self.__firstSET[self.__dic_formula[key][i][j+<span class="number">1</span>]]</span><br><span class="line">                                follows.remove(self.__emptysign)<span class="comment">#清空follow集合里面的空集</span></span><br><span class="line">                                <span class="keyword">if</span> self.__emptysign <span class="keyword">in</span> self.__dic_formula[self.__dic_formula[key][i][j+<span class="number">1</span>]]:</span><br><span class="line">                                    <span class="comment">#如果这个非终结符的产生式能产生空值</span></span><br><span class="line">                                    <span class="keyword">if</span> self.__dic_formula[key][i][j+<span class="number">1</span>] <span class="keyword">in</span> self.__followSET:</span><br><span class="line">                                        follows+=self.__followSET[self.__dic_formula[key][i][j+<span class="number">1</span>]]</span><br><span class="line">                                    <span class="keyword">else</span>:</span><br><span class="line">                                        follows+=[self.__dic_formula[key][i][j+<span class="number">1</span>]]</span><br><span class="line">                            <span class="keyword">else</span>:</span><br><span class="line">                                follows.append(self.__dic_formula[key][i][j+<span class="number">1</span>]) </span><br><span class="line">                                <span class="comment">#把非终结符后一位的放到follow集合里</span></span><br><span class="line">                            follows=list(set(follows)) <span class="comment">#follow集合去重</span></span><br><span class="line">                            self.__followSET[self.__dic_formula[key][i][j]]=follows</span><br><span class="line">                        <span class="keyword">else</span>:</span><br><span class="line">                            <span class="comment">#如果字母是最后一位的</span></span><br><span class="line">                            follows=[] <span class="comment">#清空一下</span></span><br><span class="line">                            <span class="keyword">if</span> self.__dic_formula[key][i][j] <span class="keyword">in</span> self.__followSET:</span><br><span class="line">                                <span class="comment">#如果follow集合里存在这个非终结符</span></span><br><span class="line">                                follows=self.__followSET[self.__dic_formula[key][i][j]]</span><br><span class="line">                            follows.append(key) </span><br><span class="line">                            <span class="comment">#把索引key放到follow集合里</span></span><br><span class="line">                            follows.sort()</span><br><span class="line">                            self.__followSET[self.__dic_formula[key][i][j]]=follows</span><br><span class="line">        <span class="comment">#第二步 将follow集合里面的非终结符，再取其follow</span></span><br><span class="line">        <span class="keyword">for</span> counts <span class="keyword">in</span> range(<span class="number">0</span>,len(self.__non_ter)):</span><br><span class="line">            <span class="comment">#为了保证深度，预计重叠的深度不会大于非终结符的数量</span></span><br><span class="line">            <span class="keyword">for</span> key <span class="keyword">in</span> self.__followSET:</span><br><span class="line">                <span class="comment">#重复遍历follow集合</span></span><br><span class="line">                flag_lenfollowset=len(self.__followSET[key])</span><br><span class="line">                <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">0</span>,flag_lenfollowset<span class="number">-1</span>):</span><br><span class="line">                    <span class="comment">#遍历每一个follow集里的每一个元素</span></span><br><span class="line">                    <span class="keyword">if</span> self.__followSET[key][i] <span class="keyword">in</span> self.__non_ter:</span><br><span class="line">                        <span class="comment">#如果这个元素是非终结符</span></span><br><span class="line">                        follows=[] <span class="comment">#清空初始化</span></span><br><span class="line">                        <span class="keyword">if</span> self.__followSET[key][i] <span class="keyword">in</span> self.__followSET:</span><br><span class="line">                            <span class="comment">#就怕这个是个全新的未出现的follow集合，那就尴尬了</span></span><br><span class="line">                            follows=self.__followSET[key]</span><br><span class="line">                            follows+=self.__followSET[self.__followSET[key][i]]</span><br><span class="line">                        follows=list(set(follows)) <span class="comment">#follow集合去重</span></span><br><span class="line">                        follows.sort()</span><br><span class="line">                        self.__followSET[key]=follows</span><br><span class="line">                    flag_lenfollowset=len(self.__followSET[key])</span><br><span class="line"></span><br><span class="line">        <span class="comment">#第三步 收尾，清除follow集合里面的所有非终结符</span></span><br><span class="line">        <span class="keyword">for</span> key <span class="keyword">in</span> self.__followSET:</span><br><span class="line">            i=<span class="number">0</span></span><br><span class="line">            <span class="keyword">while</span> i&lt;len(self.__followSET[key]):</span><br><span class="line">                <span class="keyword">if</span> self.__followSET[key][i] <span class="keyword">in</span> self.__non_ter:</span><br><span class="line">                    self.__followSET[key].remove(self.__followSET[key][i])</span><br><span class="line">                <span class="keyword">else</span>:</span><br><span class="line">                    i=i+<span class="number">1</span></span><br><span class="line">            self.__followSET[key].sort()</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">setterSymbol</span><span class="params">(self)</span>:</span></span><br><span class="line">        <span class="comment">#添加非终结符</span></span><br><span class="line">        <span class="keyword">for</span> key <span class="keyword">in</span> self.__dic_formula:</span><br><span class="line">            <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">0</span>,len(self.__dic_formula[key])):</span><br><span class="line">                <span class="keyword">for</span> j <span class="keyword">in</span> range(<span class="number">0</span>,len(self.__dic_formula[key][i])):</span><br><span class="line">                    <span class="keyword">if</span> self.__dic_formula[key][i][j] <span class="keyword">not</span> <span class="keyword">in</span> self.__non_ter:</span><br><span class="line">                        self.__terSymbol.append(self.__dic_formula[key][i][j])</span><br><span class="line">        self.__terSymbol=list(set(self.__terSymbol))</span><br><span class="line">        self.__terSymbol.sort()</span><br><span class="line">        print(self.__terSymbol)</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">setterSymbol_fromtxt</span><span class="params">(self)</span>:</span></span><br><span class="line">        <span class="comment">#从字符串获得终结符</span></span><br><span class="line">        <span class="keyword">for</span> temptxt <span class="keyword">in</span> self.__readtxt:</span><br><span class="line">            startindex=temptxt.index(<span class="string">"-&gt;"</span>)</span><br><span class="line">            <span class="keyword">for</span> i <span class="keyword">in</span> range(startindex+<span class="number">2</span>,len(temptxt)):</span><br><span class="line">                <span class="keyword">if</span> temptxt[i] <span class="keyword">not</span> <span class="keyword">in</span> self.__non_ter <span class="keyword">and</span> temptxt[i] !=<span class="string">"|"</span>:</span><br><span class="line">                    <span class="keyword">if</span> temptxt[i] <span class="keyword">not</span> <span class="keyword">in</span> self.__terSymbol:</span><br><span class="line">                        self.__terSymbol.append(temptxt[i])</span><br><span class="line">        self.__terSymbol.sort()</span><br><span class="line">        print(self.__terSymbol)</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">makeanalysetable</span><span class="params">(self)</span>:</span></span><br><span class="line">        <span class="comment">#构建分析表</span></span><br><span class="line">        <span class="keyword">for</span> formlula <span class="keyword">in</span> self.__dic_formula:</span><br><span class="line">            <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">0</span>,len(self.__dic_formula[formlula])):</span><br><span class="line">                firstlist=self.getsfirst_t(self.__dic_formula[formlula][i])</span><br><span class="line">                <span class="keyword">for</span> flitem <span class="keyword">in</span> firstlist:</span><br><span class="line">                    <span class="keyword">if</span> flitem!=self.__emptysign:</span><br><span class="line">                        <span class="comment">#如果非空</span></span><br><span class="line">                        tempinlist=[]</span><br><span class="line">                        <span class="keyword">if</span> flitem <span class="keyword">in</span> self.__tablem:</span><br><span class="line">                            tempinlist=self.__tablem[flitem]</span><br><span class="line">                        tempinlist.append([formlula,self.__dic_formula[formlula][i]])</span><br><span class="line">                        self.__tablem[flitem]=tempinlist</span><br><span class="line">                        <span class="comment">#print("M[" + formlula + "," + flitem + "]::" + formlula + "-&gt;" + self.__dic_formula[formlula][i])</span></span><br><span class="line">                    <span class="keyword">else</span>:</span><br><span class="line">                        <span class="comment">#如果是空</span></span><br><span class="line">                        <span class="keyword">for</span> itemfollow <span class="keyword">in</span> self.__terSymbol + [<span class="string">'#'</span>]:</span><br><span class="line">                            <span class="keyword">if</span> itemfollow <span class="keyword">in</span> self.__followSET[formlula]:</span><br><span class="line">                                tempinlist=[]</span><br><span class="line">                                <span class="keyword">if</span> itemfollow <span class="keyword">in</span> self.__tablem:</span><br><span class="line">                                    tempinlist=self.__tablem[itemfollow]</span><br><span class="line">                                tempinlist.append([formlula,self.__emptysign])</span><br><span class="line">                                self.__tablem[itemfollow]=tempinlist</span><br><span class="line">                                <span class="comment">#print("M[" + formlula + "," + itemfollow + "]::" + formlula + "-&gt;" + self.__emptysign)</span></span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">showanalytable</span><span class="params">(self)</span>:</span></span><br><span class="line">        </span><br><span class="line">        self.tb.field_names=[<span class="string">'word'</span>]+self.__terSymbol </span><br><span class="line">        <span class="keyword">for</span> nonitem <span class="keyword">in</span> self.__non_ter:</span><br><span class="line">            self.__anatable.append([nonitem]+[<span class="string">'error'</span>]*(len(self.tb.field_names)<span class="number">-1</span>))</span><br><span class="line">        <span class="comment">#显示分析表</span></span><br><span class="line">        <span class="comment">#print(self.__tablem)</span></span><br><span class="line">        <span class="keyword">for</span> items <span class="keyword">in</span> self.__tablem:</span><br><span class="line">            <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">0</span>,len(self.__tablem[items])):</span><br><span class="line">                pos_non=self.__non_ter.index(self.__tablem[items][i][<span class="number">0</span>])</span><br><span class="line">                pos_ter=self.__terSymbol.index(items)</span><br><span class="line">                <span class="comment">#print("non,"+ self.__non_ter[pos_non] +":" + str(pos_non) + " ter," + self.__terSymbol[pos_ter] + ":" + str(pos_ter) + " value:"+self.__tablem[items][i][1])</span></span><br><span class="line">                <span class="comment">#print(pos),</span></span><br><span class="line">                <span class="comment">#print("-" + self.__non_ter[pos])</span></span><br><span class="line">                self.__anatable[pos_non][pos_ter+<span class="number">1</span>]=self.__non_ter[pos_non]+<span class="string">"-&gt;"</span>+self.__tablem[items][i][<span class="number">1</span>]</span><br><span class="line">        </span><br><span class="line">        <span class="keyword">for</span> lines <span class="keyword">in</span> self.__anatable:</span><br><span class="line">            self.tb.add_row(lines)</span><br><span class="line">        </span><br><span class="line">        print(self.__anatable)</span><br><span class="line">        print(self.tb)</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">readanatable</span><span class="params">(self,A,a)</span>:</span></span><br><span class="line">        index_line=<span class="number">-1</span></span><br><span class="line">        index_row=<span class="number">-1</span></span><br><span class="line">        value=<span class="string">"null"</span></span><br><span class="line">        <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">0</span>,len(self.__anatable)<span class="number">-1</span>):</span><br><span class="line">            <span class="keyword">if</span> self.__anatable[i][<span class="number">0</span>]==A:</span><br><span class="line">                index_line=i</span><br><span class="line">                index_row=self.__terSymbol.index(a)</span><br><span class="line">                value=self.__anatable[i][index_row]</span><br><span class="line">                <span class="keyword">if</span> value!=<span class="string">'error'</span>:</span><br><span class="line">                    <span class="keyword">return</span> index_line,index_row,value</span><br><span class="line">                <span class="keyword">else</span>:</span><br><span class="line">                    index_line=<span class="number">-1</span></span><br><span class="line">                    index_row=<span class="number">-1</span></span><br><span class="line">        <span class="keyword">return</span> index_line,index_row,value</span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">MAa</span><span class="params">(self,X,a)</span>:</span></span><br><span class="line">        <span class="string">'''</span></span><br><span class="line"><span class="string">        for nonter in self.__non_ter:</span></span><br><span class="line"><span class="string">            inline,inrow,value=self.readanatable(nonter,a)</span></span><br><span class="line"><span class="string">            if inline!=-1:</span></span><br><span class="line"><span class="string">                #存在</span></span><br><span class="line"><span class="string">                if value[-1]==self.__emptysign:</span></span><br><span class="line"><span class="string">                    #如果出现最后一位是空，则什么都不做</span></span><br><span class="line"><span class="string">                    pass</span></span><br><span class="line"><span class="string">                else:</span></span><br><span class="line"><span class="string">                    print(a,inline,inrow,value)</span></span><br><span class="line"><span class="string">                    return list(value)[3:]</span></span><br><span class="line"><span class="string">        '''</span></span><br><span class="line">        <span class="comment">#print("X:",X,"a:",a)</span></span><br><span class="line">        gettxt=self.__anatable[self.__non_ter.index(X)][self.__terSymbol.index(a)+<span class="number">1</span>]</span><br><span class="line">        <span class="comment">#print(gettxt[3:])</span></span><br><span class="line">        <span class="keyword">if</span> gettxt!=<span class="string">'error'</span>:</span><br><span class="line">            <span class="keyword">return</span> list(gettxt)[<span class="number">3</span>:]</span><br><span class="line">        <span class="keyword">else</span>:</span><br><span class="line">            <span class="keyword">return</span> []</span><br><span class="line">        </span><br><span class="line">        <span class="comment">#return []</span></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">do_analayse</span><span class="params">(self)</span>:</span></span><br><span class="line">        self.tb=pt.PrettyTable()</span><br><span class="line">        self.tb.field_names=[<span class="string">'步骤'</span>,<span class="string">'符号栈'</span>,<span class="string">'输出串'</span>,<span class="string">'所用产生式'</span>]</span><br><span class="line">        self.__intxt+=<span class="string">'#'</span></span><br><span class="line">        count=<span class="number">1</span></span><br><span class="line">        STACK=[<span class="string">'#'</span>]</span><br><span class="line">        STACK.insert(<span class="number">0</span>,self.__non_ter[<span class="number">0</span>])</span><br><span class="line">        print(STACK)</span><br><span class="line">        i=<span class="number">0</span></span><br><span class="line">        a=self.__intxt[i]</span><br><span class="line">        <span class="comment">#print(a)</span></span><br><span class="line">        flag=<span class="literal">True</span></span><br><span class="line">        <span class="keyword">while</span>(flag):</span><br><span class="line">            X=STACK.pop(<span class="number">0</span>)</span><br><span class="line">            localMAa=[]</span><br><span class="line">            <span class="keyword">if</span> X <span class="keyword">in</span> self.__terSymbol:</span><br><span class="line">                <span class="comment">#如果X是终结符</span></span><br><span class="line">                <span class="keyword">if</span> X==a:</span><br><span class="line">                    i+=<span class="number">1</span></span><br><span class="line">                    <span class="keyword">if</span> i&gt;=len(self.__intxt):</span><br><span class="line">                        <span class="keyword">break</span></span><br><span class="line">                    a=self.__intxt[i]</span><br><span class="line">                    self.tb.add_row([count,<span class="string">''</span>.join(STACK),self.__intxt[i:],<span class="string">''</span>])</span><br><span class="line">                <span class="keyword">else</span>:</span><br><span class="line">                    <span class="comment">#print("1error")</span></span><br><span class="line">                    <span class="keyword">pass</span></span><br><span class="line">                <span class="keyword">pass</span></span><br><span class="line">            <span class="keyword">elif</span> X==<span class="string">'#'</span>:</span><br><span class="line">                <span class="keyword">if</span> X==a:</span><br><span class="line">                    flag=<span class="literal">False</span></span><br><span class="line">                <span class="keyword">else</span>:</span><br><span class="line">                    <span class="comment">#print("2error")</span></span><br><span class="line">                    <span class="keyword">pass</span></span><br><span class="line">                <span class="keyword">pass</span></span><br><span class="line">            <span class="keyword">elif</span> self.MAa(X,a)!=[]:</span><br><span class="line">                MA=self.MAa(X,a)</span><br><span class="line">                localMAa=MA</span><br><span class="line">                <span class="comment">#print("MA",MA)</span></span><br><span class="line">                STACK=MA+STACK</span><br><span class="line">                self.tb.add_row([count,<span class="string">''</span>.join(STACK),self.__intxt[i:],X+<span class="string">'-&gt;'</span>+<span class="string">''</span>.join(localMAa)])</span><br><span class="line">            <span class="keyword">else</span>:</span><br><span class="line">                print(<span class="string">"error"</span>)</span><br><span class="line">            <span class="comment">#print(STACK,X,a,localMAa)</span></span><br><span class="line">            count=count+<span class="number">1</span></span><br><span class="line">        print(<span class="string">"分析成功"</span>)</span><br><span class="line">        print(self.tb)</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">init_getreadyforvt</span><span class="params">(self)</span>:</span></span><br><span class="line">        self.__dic_formula[self.__non_ter[<span class="number">0</span>]].append(<span class="string">"#"</span>+self.__non_ter[<span class="number">0</span>]+<span class="string">"#"</span>)</span><br><span class="line"></span><br><span class="line">        <span class="comment">#以下为测试内容</span></span><br><span class="line">        </span><br><span class="line">        self.__dic_formula=&#123;</span><br><span class="line">            <span class="string">'E'</span>:[<span class="string">'E+T'</span>,<span class="string">'T'</span>,<span class="string">'#E#'</span>],</span><br><span class="line">            <span class="string">'T'</span>:[<span class="string">'T*F'</span>,<span class="string">'F'</span>],</span><br><span class="line">            <span class="string">'F'</span>:[<span class="string">'(E)'</span>,<span class="string">'i'</span>]</span><br><span class="line">        &#125;</span><br><span class="line">        self.__non_ter=[<span class="string">'E'</span>,<span class="string">'T'</span>,<span class="string">'F'</span>]</span><br><span class="line">        self.__terSymbol=[<span class="string">'+'</span>,<span class="string">'#'</span>,<span class="string">'*'</span>,<span class="string">'('</span>,<span class="string">')'</span>,<span class="string">'i'</span>]</span><br><span class="line">        </span><br><span class="line">        print(<span class="string">"在文法中添加#E#"</span>)</span><br><span class="line">        print(self.__dic_formula)</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">getfirstvt</span><span class="params">(self)</span>:</span></span><br><span class="line">        <span class="comment">#获取firstvt</span></span><br><span class="line">        <span class="keyword">for</span> dic_item <span class="keyword">in</span> self.__dic_formula:</span><br><span class="line">            self.getfirstVT_withdicitem(dic_item)</span><br><span class="line">        print(<span class="string">"FirstVT:"</span>,self.__firstVT)</span><br><span class="line">                    </span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">getfirstVT_withdicitem</span><span class="params">(self,dic_item)</span>:</span></span><br><span class="line">        <span class="comment">#print("step")</span></span><br><span class="line">        <span class="keyword">for</span> list_item <span class="keyword">in</span> self.__dic_formula[dic_item]:</span><br><span class="line">            <span class="keyword">if</span> list_item[<span class="number">0</span>] <span class="keyword">in</span> self.__non_ter:</span><br><span class="line">                <span class="keyword">if</span> list_item[<span class="number">0</span>]!=dic_item:</span><br><span class="line">                    self.getfirstVT_withdicitem(list_item[<span class="number">0</span>])</span><br><span class="line">                    </span><br><span class="line">                templist=[]</span><br><span class="line">                <span class="keyword">if</span> dic_item <span class="keyword">not</span> <span class="keyword">in</span> self.__firstVT:</span><br><span class="line">                    self.__firstVT[dic_item]=[]</span><br><span class="line">                <span class="keyword">else</span>:</span><br><span class="line">                    templist=self.__firstVT[dic_item]</span><br><span class="line">                <span class="keyword">if</span> len(list_item)&gt;=<span class="number">2</span> <span class="keyword">and</span> list_item[<span class="number">1</span>] <span class="keyword">in</span> self.__terSymbol:</span><br><span class="line">                    </span><br><span class="line">                    <span class="keyword">if</span> dic_item <span class="keyword">in</span> self.__firstVT:</span><br><span class="line">                        templist=self.__firstVT[dic_item]</span><br><span class="line">                    <span class="comment">#if list_item[1] not in templist:</span></span><br><span class="line">                    templist.append(list_item[<span class="number">1</span>])</span><br><span class="line">                    <span class="comment">#print(dic_item,list_item[1],templist)</span></span><br><span class="line">                </span><br><span class="line">                self.__firstVT[dic_item]=templist + self.__firstVT[list_item[<span class="number">0</span>]]</span><br><span class="line">                self.__firstVT[dic_item]=list(set(self.__firstVT[dic_item]))</span><br><span class="line">                <span class="comment">#print(self.__firstVT)</span></span><br><span class="line">            <span class="keyword">else</span>:</span><br><span class="line">                <span class="comment">#第一位是终结符</span></span><br><span class="line">                templist=[]</span><br><span class="line">                <span class="keyword">if</span> dic_item <span class="keyword">in</span> self.__firstVT:</span><br><span class="line">                    templist=self.__firstVT[dic_item]</span><br><span class="line">                <span class="keyword">if</span> list_item[<span class="number">0</span>] <span class="keyword">not</span> <span class="keyword">in</span> templist:</span><br><span class="line">                    templist.append(list_item[<span class="number">0</span>])</span><br><span class="line">                self.__firstVT[dic_item]=templist</span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">getlastvt</span><span class="params">(self)</span>:</span></span><br><span class="line">        <span class="comment">#print("-----------lastvt")</span></span><br><span class="line">        <span class="keyword">for</span> dic_item <span class="keyword">in</span> self.__dic_formula:</span><br><span class="line">            self.getlastVT_withdicitem(dic_item,<span class="number">0</span>)</span><br><span class="line">        </span><br><span class="line">        <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">0</span>,len(self.__non_ter)<span class="number">-1</span>):</span><br><span class="line">            <span class="keyword">for</span> dic_item <span class="keyword">in</span> self.__lastVT:</span><br><span class="line">                <span class="keyword">for</span> list_item <span class="keyword">in</span> self.__lastVT[dic_item]:</span><br><span class="line">                    </span><br><span class="line">                    <span class="keyword">if</span> list_item <span class="keyword">in</span> self.__non_ter:</span><br><span class="line">                        <span class="comment">#如果是非终结符</span></span><br><span class="line">                        <span class="comment">#print(list_item," non ",self.__lastVT[list_item])</span></span><br><span class="line">                        templast=[]</span><br><span class="line">                        templast=self.__lastVT[dic_item]</span><br><span class="line">                        templast.remove(list_item)</span><br><span class="line">                        templast+=self.__lastVT[list_item]</span><br><span class="line">                        self.__lastVT[dic_item]=templast</span><br><span class="line">        print(<span class="string">"LastVT:"</span>,self.__lastVT)</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">getlastVT_withdicitem</span><span class="params">(self,dic_item,deeplevel)</span>:</span></span><br><span class="line"></span><br><span class="line">        <span class="keyword">for</span> list_item <span class="keyword">in</span> self.__dic_formula[dic_item]:</span><br><span class="line">            <span class="comment">#print(list_item[-1])</span></span><br><span class="line">            <span class="keyword">if</span> list_item[<span class="number">-1</span>] <span class="keyword">in</span> self.__non_ter:</span><br><span class="line">                <span class="comment">#最后一位非终结符</span></span><br><span class="line">                <span class="comment">#print(dic_item,list_item[-1],list_item[-2])</span></span><br><span class="line">                <span class="keyword">if</span> dic_item!=list_item[<span class="number">-1</span>]:</span><br><span class="line">                    <span class="comment">#说明</span></span><br><span class="line">                    self.getlastVT_withdicitem(list_item[<span class="number">-1</span>],deeplevel+<span class="number">1</span>)</span><br><span class="line">                templist=[]</span><br><span class="line">                <span class="keyword">if</span> dic_item <span class="keyword">not</span> <span class="keyword">in</span> self.__lastVT:</span><br><span class="line">                    self.__lastVT[dic_item]=[]</span><br><span class="line">                <span class="keyword">else</span>:</span><br><span class="line">                    templist=self.__lastVT[dic_item]</span><br><span class="line">                </span><br><span class="line">                <span class="keyword">if</span> len(list_item)&gt;=<span class="number">2</span> <span class="keyword">and</span> list_item[<span class="number">-2</span>] <span class="keyword">in</span> self.__terSymbol:</span><br><span class="line">                    </span><br><span class="line">                    <span class="keyword">if</span> dic_item <span class="keyword">in</span> self.__lastVT:</span><br><span class="line">                        templist=self.__lastVT[dic_item]</span><br><span class="line">                    <span class="keyword">if</span> list_item[<span class="number">-2</span>] <span class="keyword">not</span> <span class="keyword">in</span> templist:</span><br><span class="line">                        templist.append(list_item[<span class="number">-2</span>])</span><br><span class="line">                    <span class="comment">#print("last-&gt;",dic_item,list_item[-2],templist)</span></span><br><span class="line">                self.__lastVT[dic_item]=templist+self.__lastVT[list_item[<span class="number">-1</span>]]</span><br><span class="line">                self.__lastVT[dic_item]=list(set(self.__lastVT[dic_item]))</span><br><span class="line">            <span class="keyword">else</span>:</span><br><span class="line">                <span class="comment">#print(dic_item,list_item[-1])</span></span><br><span class="line">                <span class="comment">#最后一位是终结符</span></span><br><span class="line">                templist=[]</span><br><span class="line">                <span class="keyword">if</span> dic_item <span class="keyword">in</span> self.__lastVT:</span><br><span class="line">                    templist=self.__lastVT[dic_item]</span><br><span class="line">                <span class="keyword">if</span> list_item[<span class="number">-1</span>] <span class="keyword">not</span> <span class="keyword">in</span> templist:</span><br><span class="line">                    templist.append(list_item[<span class="number">-1</span>])</span><br><span class="line">                self.__lastVT[dic_item]=templist</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">getmatch</span><span class="params">(self,instring)</span>:</span></span><br><span class="line">        nonter=<span class="string">""</span></span><br><span class="line">        <span class="keyword">for</span> non <span class="keyword">in</span> self.__non_ter:</span><br><span class="line">            nonter=nonter + <span class="string">"|"</span> + non</span><br><span class="line">        nonter=<span class="string">"["</span> + nonter[<span class="number">1</span>:] + <span class="string">"]"</span></span><br><span class="line">        symter=<span class="string">""</span></span><br><span class="line">        <span class="keyword">for</span> tym <span class="keyword">in</span> self.__terSymbol:</span><br><span class="line">            symter=symter + <span class="string">"|"</span> + tym</span><br><span class="line">        symter=<span class="string">"["</span> + symter[<span class="number">1</span>:] +<span class="string">"]"</span></span><br><span class="line">        <span class="comment">#print(nonter," ",symter)</span></span><br><span class="line">        <span class="comment">#print("-&gt;",instring) </span></span><br><span class="line">        self.getmatch_equl(instring,nonter,symter)</span><br><span class="line">        self.getmatch_slower(instring,nonter,symter)</span><br><span class="line">        self.getmatch_quicker(instring,nonter,symter)</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">getmatch_equl</span><span class="params">(self,instring,nonter,symter)</span>:</span></span><br><span class="line">        pattern=re.compile(<span class="string">r''</span>+symter + nonter + symter)</span><br><span class="line">        result=pattern.findall(instring)  <span class="comment">#匹配aQa型</span></span><br><span class="line">        <span class="keyword">if</span> result!=[]:</span><br><span class="line">            <span class="comment">#print("aQa-&gt;(=)",result)</span></span><br><span class="line">            <span class="comment">#有结果</span></span><br><span class="line">            <span class="keyword">for</span> resitem <span class="keyword">in</span> result:</span><br><span class="line">                <span class="comment">#print(resitem[0],"=",resitem[-1])</span></span><br><span class="line">                self.settableat(self.__terSymbol.index(resitem[<span class="number">0</span>]),self.__terSymbol.index(resitem[<span class="number">-1</span>]),<span class="string">'='</span>)</span><br><span class="line"></span><br><span class="line">        </span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">getmatch_quicker</span><span class="params">(self,instring,nonter,symter)</span>:</span></span><br><span class="line">        <span class="comment">#优先级高于</span></span><br><span class="line">        pattern=re.compile(<span class="string">r''</span>+nonter+symter)</span><br><span class="line">        result=pattern.findall(instring) <span class="comment">#匹配aQ型</span></span><br><span class="line">        <span class="keyword">if</span> result!=[]:</span><br><span class="line">            <span class="comment">#print("Qa-&gt;(&gt;)",result)</span></span><br><span class="line">            <span class="keyword">for</span> resitem <span class="keyword">in</span> result:</span><br><span class="line">                <span class="keyword">for</span> lasitem <span class="keyword">in</span> self.__lastVT[resitem[<span class="number">0</span>]]:</span><br><span class="line">                    <span class="comment">#print(lasitem,"&gt;",resitem[1])</span></span><br><span class="line">                    self.settableat(self.__terSymbol.index(lasitem),self.__terSymbol.index(resitem[<span class="number">1</span>]),<span class="string">"&gt;"</span>)</span><br><span class="line">        </span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">getmatch_slower</span><span class="params">(self,instring,nonter,symter)</span>:</span></span><br><span class="line">        <span class="comment">#优先级低于</span></span><br><span class="line">        pattern=re.compile(<span class="string">r''</span>+symter+nonter)</span><br><span class="line">        result=pattern.findall(instring) <span class="comment">#匹配aQ型</span></span><br><span class="line">        <span class="keyword">if</span> result!=[]:</span><br><span class="line">            <span class="comment">#print("aQ-&gt;(&lt;)",result)</span></span><br><span class="line">            <span class="keyword">for</span> resitem <span class="keyword">in</span> result:</span><br><span class="line">                <span class="keyword">for</span> lasitem <span class="keyword">in</span> self.__firstVT[resitem[<span class="number">-1</span>]]:</span><br><span class="line">                    <span class="comment">#print(resitem[0],"&lt;",lasitem)</span></span><br><span class="line">                    self.settableat(self.__terSymbol.index(resitem[<span class="number">0</span>]),self.__terSymbol.index(lasitem),<span class="string">"&lt;"</span>)</span><br><span class="line">        </span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">settableat</span><span class="params">(self,i,j,value)</span>:</span></span><br><span class="line">        <span class="comment">#i为行，j为列，value为值</span></span><br><span class="line">        <span class="keyword">if</span> self.__yxjtable[i,j]==<span class="string">'?'</span>:</span><br><span class="line">            self.__yxjtable[i,j]=value</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">getindextable</span><span class="params">(self)</span>:</span></span><br><span class="line">        <span class="comment">#获取优先级表</span></span><br><span class="line">        <span class="comment">#优先级表初始化</span></span><br><span class="line">        self.__yxjtable=numpy.full((len(self.__terSymbol),len(self.__terSymbol)),<span class="string">"?"</span>)</span><br><span class="line">        <span class="keyword">for</span> dic_item <span class="keyword">in</span> self.__dic_formula:</span><br><span class="line">            <span class="keyword">for</span> list_item <span class="keyword">in</span> self.__dic_formula[dic_item]:</span><br><span class="line">                self.getmatch(list_item)</span><br><span class="line">        print(self.__yxjtable)</span><br><span class="line"></span><br><span class="line">        print(<span class="string">"显示为优先级表格"</span>)</span><br><span class="line">        self.tb=pt.PrettyTable()</span><br><span class="line">        li=self.__yxjtable.tolist()</span><br><span class="line">        self.tb.field_names=[<span class="string">'word'</span>]+self.__terSymbol </span><br><span class="line">        <span class="comment">#print(len(li))</span></span><br><span class="line">        <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">0</span>,len(li)):</span><br><span class="line">            self.tb.add_row([self.__terSymbol[i]]+li[i])</span><br><span class="line">        print(self.tb)</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">printall</span><span class="params">(self)</span>:</span></span><br><span class="line">        print(<span class="string">"-------结果--------"</span>)</span><br><span class="line">        print(<span class="string">"--产生式："</span>)</span><br><span class="line">        print(self.__dic_formula)</span><br><span class="line">        print(<span class="string">"--终结符："</span>)</span><br><span class="line">        print(self.__terSymbol)</span><br><span class="line">        print(<span class="string">"--非终结符："</span>)</span><br><span class="line">        print(self.__non_ter)</span><br><span class="line">        print(<span class="string">"--first集："</span>)</span><br><span class="line">        print(self.__firstSET)</span><br><span class="line">        print(<span class="string">"--follow集："</span>)</span><br><span class="line">        print(self.__followSET)</span><br><span class="line">        </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">readletters</span><span class="params">(self,filepath)</span>:</span></span><br><span class="line">        <span class="comment">#从文本文件读取数据</span></span><br><span class="line">        print(<span class="string">"文本中的句子是："</span>)</span><br><span class="line">        fileread=open(filepath,mode=<span class="string">'r'</span>)</span><br><span class="line">        filereadtxt=fileread.read()</span><br><span class="line">        print(filereadtxt)</span><br><span class="line">        self.__intxt=filereadtxt</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">findhigherlevel</span><span class="params">(self,righttext)</span>:</span></span><br><span class="line">        <span class="comment">#找上一级的说法,返回[a,b]表示要替换掉的位,c表示替换的内容</span></span><br><span class="line">        <span class="keyword">for</span> dic_item <span class="keyword">in</span> self.__dic_formula:</span><br><span class="line">            <span class="keyword">for</span> list_item <span class="keyword">in</span> self.__dic_formula[dic_item]:</span><br><span class="line">                getindex=righttext.find(list_item)</span><br><span class="line">                <span class="keyword">if</span> getindex!=<span class="number">-1</span>:</span><br><span class="line">                    <span class="comment">#找到了匹配项</span></span><br><span class="line">                    <span class="keyword">return</span> [getindex,getindex+len(list_item)],dic_item</span><br><span class="line">        <span class="keyword">return</span> [],<span class="string">'null'</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">getindexbefore</span><span class="params">(self,lefttext)</span>:</span></span><br><span class="line">        <span class="comment">#从左侧的栈中，从右至左找到第一个终结符并返回</span></span><br><span class="line">        <span class="keyword">for</span> i <span class="keyword">in</span> range(len(lefttext)<span class="number">-1</span>,<span class="number">0</span>,<span class="number">-1</span>):</span><br><span class="line">            <span class="keyword">if</span> lefttext[i] <span class="keyword">in</span> self.__terSymbol:</span><br><span class="line">                <span class="keyword">return</span> lefttext[i]</span><br><span class="line">        <span class="keyword">return</span> <span class="string">'#'</span></span><br><span class="line">    </span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">redothetext</span><span class="params">(self)</span>:</span></span><br><span class="line">        lefttext=[<span class="string">'#'</span>]</span><br><span class="line">        righttext=list(self.__intxt) + [<span class="string">'#'</span>]</span><br><span class="line">        self.tb=pt.PrettyTable()</span><br><span class="line">        self.tb.field_names=[<span class="string">'步骤'</span>,<span class="string">'栈'</span>,<span class="string">'优先关系'</span>,<span class="string">'当前符号'</span>,<span class="string">'剩余符号'</span>,<span class="string">'动作'</span>]</span><br><span class="line">        i=<span class="number">1</span></span><br><span class="line">        <span class="keyword">while</span>(righttext!=[<span class="string">'#'</span>]):</span><br><span class="line">            dotext=<span class="string">""</span></span><br><span class="line">            getnext=self.__yxjtable[self.__terSymbol.index(self.getindexbefore( lefttext)), self.__terSymbol.index(righttext[<span class="number">0</span>])]</span><br><span class="line">            <span class="keyword">if</span> getnext==<span class="string">'&gt;'</span>:</span><br><span class="line">                getlist,mom=self.findhigherlevel(<span class="string">''</span>.join(lefttext))</span><br><span class="line">                <span class="keyword">if</span> mom!=<span class="string">'null'</span>:</span><br><span class="line">                    <span class="comment">#找到了</span></span><br><span class="line">                    stringlefttext=<span class="string">''</span>.join(lefttext)</span><br><span class="line">                    stringlefttext=stringlefttext[:getlist[<span class="number">0</span>]]+mom</span><br><span class="line">                    lefttext=list(stringlefttext)</span><br><span class="line">                    print(<span class="string">"change:"</span>,<span class="string">''</span>.join(lefttext),<span class="string">" to "</span>,stringlefttext[:getlist[<span class="number">0</span>]]+mom)</span><br><span class="line">                dotext=<span class="string">"规约"</span></span><br><span class="line">            <span class="keyword">else</span>:</span><br><span class="line">                lefttext.append(righttext.pop(<span class="number">0</span>))</span><br><span class="line">                dotext=<span class="string">"进位"</span></span><br><span class="line">            </span><br><span class="line">            self.tb.add_row([i,<span class="string">''</span>.join(lefttext),getnext,lefttext[<span class="number">-1</span>],<span class="string">''</span>.join(righttext),dotext])</span><br><span class="line">            <span class="comment">#print([i,lefttext,getnext,lefttext[-1],righttext,'none'])</span></span><br><span class="line">            i=i+<span class="number">1</span></span><br><span class="line">            <span class="keyword">pass</span></span><br><span class="line"></span><br><span class="line">        </span><br><span class="line">        print(self.tb)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">        <span class="keyword">pass</span></span><br></pre></td></tr></table></figure>

<p>之后可以在另一个文件里引用，就非常的简单</p>
<p>test2.py</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#!/usr/bin/python</span></span><br><span class="line"><span class="comment"># -*- coding: UTF-8 -*-</span></span><br><span class="line"><span class="keyword">import</span> tc2</span><br><span class="line"><span class="keyword">import</span> os</span><br><span class="line"></span><br><span class="line">print(<span class="string">"\033c"</span>) <span class="comment">#清屏</span></span><br><span class="line">x=tc2.tc2()</span><br><span class="line">x.insert_wf(<span class="string">"h1.txt"</span>)</span><br><span class="line">x.setterSymbol_fromtxt()</span><br><span class="line">x.switchleft2notleft()</span><br><span class="line">x.setterSymbol()  <span class="comment">#已被抛弃</span></span><br><span class="line"><span class="comment">#此时已经完成终结符和非终结符的获取</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">x.getsfirst_t()</span><br><span class="line">x.getsfollow_d()</span><br><span class="line"></span><br><span class="line">x.printall()</span><br><span class="line">x.makeanalysetable()</span><br><span class="line">x.showanalytable()</span><br><span class="line">x.readletters(<span class="string">"h2.txt"</span>)</span><br><span class="line">x.do_analayse()</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="string">'''</span></span><br><span class="line"><span class="string">#实验三</span></span><br><span class="line"><span class="string">x.init_getreadyforvt()</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">x.getfirstvt()</span></span><br><span class="line"><span class="string">x.getlastvt()</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">x.getindextable()</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">x.readletters("h2.txt")</span></span><br><span class="line"><span class="string">x.redothetext()</span></span><br><span class="line"><span class="string">'''</span></span><br></pre></td></tr></table></figure>

<p>在使用时，只需要</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python test2.py</span><br></pre></td></tr></table></figure>

<p>即可运行～，文法存放在h1.txt中，于同一目录下，格式如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">E-&gt;E+T|T</span><br><span class="line">T-&gt;T*F|F</span><br><span class="line">F-&gt;(E)|i</span><br></pre></td></tr></table></figure>

<p>h2.txt存放输入串</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">i*i+i</span><br></pre></td></tr></table></figure>



<p>最后输出的结果如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">-------实验二-预测分析算法的设计与实现---------</span><br><span class="line">作者：王政乔 20160520126</span><br><span class="line">----文本内容----</span><br><span class="line">[&#39;E-&gt;E+T|T&#39;, &#39;T-&gt;T*F|F&#39;, &#39;F-&gt;(E)|i&#39;]</span><br><span class="line">[&#39;E-&gt;E+T|T&#39;, &#39;T-&gt;T*F|F&#39;, &#39;F-&gt;(E)|i&#39;]</span><br><span class="line">&#123;&#39;E&#39;: [&#39;E+T&#39;, &#39;T&#39;], &#39;T&#39;: [&#39;T*F&#39;, &#39;F&#39;], &#39;F&#39;: [&#39;(E)&#39;, &#39;i&#39;]&#125;</span><br><span class="line">[&#39;E&#39;, &#39;T&#39;, &#39;F&#39;]</span><br><span class="line">[&#39;#&#39;, &#39;(&#39;, &#39;)&#39;, &#39;*&#39;, &#39;+&#39;, &#39;i&#39;]</span><br><span class="line">经过消除左递归： &#123;&#39;E&#39;: [&#39;+TA&#39;, &#39;TA&#39;], &#39;T&#39;: [&#39;*FB&#39;, &#39;FB&#39;], &#39;F&#39;: [&#39;(E)&#39;, &#39;i&#39;], &#39;A&#39;: [&#39;+TA&#39;, &#39;$&#39;], &#39;B&#39;: [&#39;*FB&#39;, &#39;$&#39;]&#125;</span><br><span class="line">[&#39;#&#39;, &#39;$&#39;, &#39;(&#39;, &#39;)&#39;, &#39;*&#39;, &#39;+&#39;, &#39;i&#39;]</span><br><span class="line">-------结果--------</span><br><span class="line">--产生式：</span><br><span class="line">&#123;&#39;E&#39;: [&#39;+TA&#39;, &#39;TA&#39;], &#39;T&#39;: [&#39;*FB&#39;, &#39;FB&#39;], &#39;F&#39;: [&#39;(E)&#39;, &#39;i&#39;], &#39;A&#39;: [&#39;+TA&#39;, &#39;$&#39;], &#39;B&#39;: [&#39;*FB&#39;, &#39;$&#39;]&#125;</span><br><span class="line">--终结符：</span><br><span class="line">[&#39;#&#39;, &#39;$&#39;, &#39;(&#39;, &#39;)&#39;, &#39;*&#39;, &#39;+&#39;, &#39;i&#39;]</span><br><span class="line">--非终结符：</span><br><span class="line">[&#39;E&#39;, &#39;T&#39;, &#39;F&#39;, &#39;A&#39;, &#39;B&#39;]</span><br><span class="line">--first集：</span><br><span class="line">&#123;&#39;E&#39;: [&#39;(&#39;, &#39;*&#39;, &#39;+&#39;, &#39;i&#39;], &#39;T&#39;: [&#39;(&#39;, &#39;*&#39;, &#39;i&#39;], &#39;F&#39;: [&#39;(&#39;, &#39;i&#39;], &#39;A&#39;: [&#39;$&#39;, &#39;+&#39;], &#39;B&#39;: [&#39;$&#39;, &#39;*&#39;]&#125;</span><br><span class="line">--follow集：</span><br><span class="line">&#123;&#39;E&#39;: [&#39;#&#39;, &#39;)&#39;], &#39;T&#39;: [&#39;#&#39;, &#39;)&#39;, &#39;+&#39;], &#39;A&#39;: [&#39;#&#39;, &#39;)&#39;], &#39;F&#39;: [&#39;#&#39;, &#39;)&#39;, &#39;*&#39;, &#39;+&#39;], &#39;B&#39;: [&#39;#&#39;, &#39;)&#39;, &#39;+&#39;]&#125;</span><br><span class="line">[[&#39;E&#39;, &#39;error&#39;, &#39;error&#39;, &#39;E-&gt;TA&#39;, &#39;error&#39;, &#39;E-&gt;TA&#39;, &#39;E-&gt;+TA&#39;, &#39;E-&gt;TA&#39;], [&#39;T&#39;, &#39;error&#39;, &#39;error&#39;, &#39;T-&gt;FB&#39;, &#39;error&#39;, &#39;T-&gt;*FB&#39;, &#39;error&#39;, &#39;T-&gt;FB&#39;], [&#39;F&#39;, &#39;error&#39;, &#39;error&#39;, &#39;F-&gt;(E)&#39;, &#39;error&#39;, &#39;error&#39;, &#39;error&#39;, &#39;F-&gt;i&#39;], [&#39;A&#39;, &#39;A-&gt;$&#39;, &#39;error&#39;, &#39;error&#39;, &#39;A-&gt;$&#39;, &#39;error&#39;, &#39;A-&gt;+TA&#39;, &#39;error&#39;], [&#39;B&#39;, &#39;B-&gt;$&#39;, &#39;error&#39;, &#39;error&#39;, &#39;B-&gt;$&#39;, &#39;B-&gt;*FB&#39;, &#39;B-&gt;$&#39;, &#39;error&#39;]]</span><br><span class="line">+------+-------+-------+--------+-------+--------+--------+-------+</span><br><span class="line">| word |   #   |   $   |   (    |   )   |   *    |   +    |   i   |</span><br><span class="line">+------+-------+-------+--------+-------+--------+--------+-------+</span><br><span class="line">|  E   | error | error | E-&gt;TA  | error | E-&gt;TA  | E-&gt;+TA | E-&gt;TA |</span><br><span class="line">|  T   | error | error | T-&gt;FB  | error | T-&gt;*FB | error  | T-&gt;FB |</span><br><span class="line">|  F   | error | error | F-&gt;(E) | error | error  | error  |  F-&gt;i |</span><br><span class="line">|  A   |  A-&gt;$ | error | error  |  A-&gt;$ | error  | A-&gt;+TA | error |</span><br><span class="line">|  B   |  B-&gt;$ | error | error  |  B-&gt;$ | B-&gt;*FB |  B-&gt;$  | error |</span><br><span class="line">+------+-------+-------+--------+-------+--------+--------+-------+</span><br><span class="line">文本中的句子是：</span><br><span class="line">i*i+i</span><br><span class="line">[&#39;E&#39;, &#39;#&#39;]</span><br><span class="line">分析成功</span><br><span class="line">+------+--------+--------+------------+</span><br><span class="line">| 步骤 | 符号栈 | 输出串 | 所用产生式 |</span><br><span class="line">+------+--------+--------+------------+</span><br><span class="line">|  1   |  TA#   | i*i+i# |   E-&gt;TA    |</span><br><span class="line">|  2   |  FBA#  | i*i+i# |   T-&gt;FB    |</span><br><span class="line">|  3   |  iBA#  | i*i+i# |    F-&gt;i    |</span><br><span class="line">|  4   |  BA#   | *i+i#  |            |</span><br><span class="line">|  5   | *FBA#  | *i+i#  |   B-&gt;*FB   |</span><br><span class="line">|  6   |  FBA#  |  i+i#  |            |</span><br><span class="line">|  7   |  iBA#  |  i+i#  |    F-&gt;i    |</span><br><span class="line">|  8   |  BA#   |  +i#   |            |</span><br><span class="line">|  9   |  $A#   |  +i#   |    B-&gt;$    |</span><br><span class="line">|  11  |  +TA#  |  +i#   |   A-&gt;+TA   |</span><br><span class="line">|  12  |  TA#   |   i#   |            |</span><br><span class="line">|  13  |  FBA#  |   i#   |   T-&gt;FB    |</span><br><span class="line">|  14  |  iBA#  |   i#   |    F-&gt;i    |</span><br><span class="line">|  15  |  BA#   |   #    |            |</span><br><span class="line">|  16  |  $A#   |   #    |    B-&gt;$    |</span><br><span class="line">|  18  |   $#   |   #    |    A-&gt;$    |</span><br><span class="line">+------+--------+--------+------------+</span><br><span class="line">joger@joger-PC:~&#x2F;Documents&#x2F;编译原理&#x2F;test2$</span><br></pre></td></tr></table></figure>


            
        </div>
        
            <div style="text-align:left;font-size:14px;">
                <p style="text-align:center;color: #ccc;">-------------本文结束<i class="fas fa-eye"></i>感谢您的阅读-------------</p>
                
            </div>
            <ul class="post-copyright">
                <li class="post-copyright-license">
                    <strong>版权声明： </strong>
                    采用<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/">知识共享署名2.5</a>许可。<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/"><img alt="知识共享许可协议" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/2.5/cn/80x15.png" /></a>
                  </li>

                <li class="post-copyright-link">
                 <strong>本文作者：</strong>
                 王政乔
               </li>
       
               <li class="post-copyright-link">
                 <strong>本文标题：</strong>
                 编译原理实验二：预测分析算法的设计与实现（最终）
               </li>
       
               <li class="post-copyright-link">
                 <strong>本文链接：</strong>
                 https://www.zhengqiao.wang/2018-11-15-编译原理实验二预测分析算法的设计与实现/
               </li>
       
               
             </ul>
        

        
        
        <div class="level is-size-7 is-uppercase">
            <div class="level-start">
                <div class="level-item">
                    <span class="is-size-6 has-text-grey has-mr-7">#</span>
                    <a class="has-link-grey -link" href="/tags/python/" rel="tag">python</a>
                </div>
            </div>
        </div>
        
        
        
        <div class="social-share"></div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css">
<script src="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js"></script>
        
    </div>
</div>



<div class="card">
    <div class="card-content">
        <h3 class="menu-label has-text-centered">喜欢这篇文章？打赏一下作者吧</h3>
        <div class="buttons is-centered">
            
                
<a class="button is-info donate">
    <span class="icon is-small">
        <i class="fab fa-alipay"></i>
    </span>
    <span>支付宝</span>
    <div class="qrcode"><img src="/images/%E6%94%AF%E4%BB%98%E5%AE%9D%E6%94%B6%E6%AC%BE%E7%A0%81.jpg" alt="支付宝"></div>
</a>

                
                
<a class="button is-success donate">
    <span class="icon is-small">
        <i class="fab fa-weixin"></i>
    </span>
    <span>微信</span>
    <div class="qrcode"><img src="/images/%E5%BE%AE%E4%BF%A1%E8%B5%9E%E8%B5%8F%E7%A0%81.png" alt="微信"></div>
</a>

                
        </div>
    </div>
</div>



<div class="card card-transparent">
    <div class="level post-navigation is-flex-wrap is-mobile">
        
        <div class="level-start">
            <a class="level level-item has-link-grey  article-nav-prev" href="/2018-12-06-JSP%E5%A4%A7%E4%BD%9C%E4%B8%9A-%E5%AE%9E%E9%AA%8C%E5%AE%A4%E5%AD%A6%E7%94%9F%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F/">
                <i class="level-item fas fa-chevron-left"></i>
                <span class="level-item">JSP大作业-学生管理系统</span>
            </a>
        </div>
        
        
        <div class="level-end">
            <a class="level level-item has-link-grey  article-nav-next" href="/2018-11-24-NAO%E6%9C%BA%E5%99%A8%E4%BA%BA%E7%BA%A2%E7%90%83%E6%A3%80%E6%B5%8B/">
                <span class="level-item">Nao机器人上实现红球检测</span>
                <i class="level-item fas fa-chevron-right"></i>
            </a>
        </div>
        
    </div>
</div>



<div class="card">
    <div class="card-content">
        <h3 class="title is-5 has-text-weight-normal">评论</h3>
        
<div id="valine-thread" class="content"></div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/valine@1.3.10/dist/Valine.min.js"></script>
<script>
    new Valine({
        el: '#valine-thread' ,
        notify: true,
        verify: true,
        app_id: 'DNC4dhA3KwUWSaeLWxwFjSmD-gzGzoHsz',
        app_key: 'ileLtaXmaLu8lsvqSqIAg195',
        placeholder: 'xxxxxxxx'
    });
</script>

    </div>
</div>

</div>
                




<div class="column is-4-tablet is-4-desktop is-3-widescreen  has-order-1 column-left is-sticky">
    
        
<div class="card widget">
    <div class="card-content">
        <nav class="level">
            <div class="level-item has-text-centered" style="flex-shrink: 1">
                <div>
                    
                    <figure class="image is-128x128 has-mb-6">
                        <img class="" src="/images/%E6%B1%9D%E7%AD%89%E7%9C%8B%E5%A5%BD%E6%88%91%E6%98%AF%E4%BD%A0%E4%B9%94%E5%93%A5%E7%81%B5%E5%8A%A8%E5%A4%B4%E5%83%8F.jpg" alt="王政乔">
                    </figure>
                    
                    <p class="is-size-4 is-block">
                        王政乔
                    </p>
                    
                    
                    <p class="is-size-6 is-block">
                        毕业啦！！！准备工作！
                    </p>
                    
                    
                    <p class="is-size-6 is-flex is-flex-center has-text-grey">
                        <i class="fas fa-map-marker-alt has-mr-7"></i>
                        <span>中华人民共和国 河南省 郑州市</span>
                    </p>
                    
                </div>
            </div>
        </nav>
        <nav class="level is-mobile">
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        文章
                    </p>
                    <a href="/archives">
                        <p class="title has-text-weight-normal">
                            67
                        </p>
                    </a>
                </div>
            </div>
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        分类
                    </p>
                    <a href="/categories">
                        <p class="title has-text-weight-normal">
                            17
                        </p>
                    </a>
                </div>
            </div>
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        标签
                    </p>
                    <a href="/tags">
                        <p class="title has-text-weight-normal">
                            48
                        </p>
                    </a>
                </div>
            </div>
        </nav>
        
        <div class="level">
            <a class="level-item button is-link is-rounded" href="https://gitee.com/JogerQiao" target="_blank" rel="noopener">
                关注我</a>
        </div>
        
        
        
        <div class="level is-mobile">
            
            <a class="level-item button is-white is-marginless" target="_blank" rel="noopener"
                title="Gitee" href="https://gitee.com/JogerQiao">
                
                <i class="iconfont icon-gitee-fill-round"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" rel="noopener"
                title="知乎" href="https://www.zhihu.com/people/joger-81">
                
                <i class="iconfont icon-zhihu"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" rel="noopener"
                title="我的邮箱" href="mailto:me@zhengqiao.wang">
                
                <i class="iconfont icon-mail"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" rel="noopener"
                title="Bilibili" href="https://space.bilibili.com/83542572">
                
                <i class="iconfont icon-bilibili-line"></i>
                
            </a>
            
        </div>
        
    </div>
</div>
    
        

    <div class="card widget" id="toc">
        <div class="card-content">
            <div class="menu">
                <h3 class="menu-label">
                    目录
                </h3>
                <ul class="menu-list"><li>
        <a class="is-flex" href="#编译原理实验二：预测分析算法的设计与实现">
        <span class="has-mr-6">1</span>
        <span>编译原理实验二：预测分析算法的设计与实现</span>
        </a></li></ul>
            </div>
        </div>
    </div>

    
        <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            链接
        </h3>
        <ul class="menu-list">
        
            <li>
                <a class="level is-mobile" href="https://hexo.io" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">Hexo</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">hexo.io</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://github.com/ppoffice" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">PPOffice</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">github.com</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="http://mtics.top" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">李志伟-吾人为学</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">mtics.top</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://expoli.tech/" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">糖醋鱼</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">expoli.tech</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://zzuyy519blog.top/" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">羊老头</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">zzuyy519blog.top</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://shuangzu.top/" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">郑州大学双足实验室</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">shuangzu.top</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://www.leeyiding.com/" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">LeeYD · Blog</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">www.leeyiding.com</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://shiyousan.com/" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">十有三</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">shiyousan.com</span>
                    </span>
                </a>
            </li>
        
        </ul>
        </div>
    </div>
</div>

    
    
        <div class="column-right-shadow is-hidden-widescreen ">
        
            
<div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                分类
            </h3>
            <ul class="menu-list">
            <li>
        <a class="level is-marginless" href="/categories/%E5%85%AC%E5%91%8A/">
            <span class="level-start">
                <span class="level-item">公告</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/">
            <span class="level-start">
                <span class="level-item">技术分享</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">58</span>
            </span>
        </a><ul><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Android/">
            <span class="level-start">
                <span class="level-item">Android</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/C/">
            <span class="level-start">
                <span class="level-item">C++</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">14</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Docker/">
            <span class="level-start">
                <span class="level-item">Docker</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Java/">
            <span class="level-start">
                <span class="level-item">Java</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">6</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Linux/">
            <span class="level-start">
                <span class="level-item">Linux</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">3</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/NAO/">
            <span class="level-start">
                <span class="level-item">NAO</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">7</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Python/">
            <span class="level-start">
                <span class="level-item">Python</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E5%89%8D%E7%AB%AF/">
            <span class="level-start">
                <span class="level-item">前端</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E5%8C%BB%E5%AD%A6%E5%9B%BE%E5%83%8F/">
            <span class="level-start">
                <span class="level-item">医学图像</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">2</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">
            <span class="level-start">
                <span class="level-item">机器学习</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E6%A0%91%E8%8E%93%E6%B4%BE/">
            <span class="level-start">
                <span class="level-item">树莓派</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li></ul></li><li>
        <a class="level is-marginless" href="/categories/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/">
            <span class="level-start">
                <span class="level-item">课程设计</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a><ul><li>
        <a class="level is-marginless" href="/categories/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/%E5%B5%8C%E5%85%A5%E5%BC%8F/">
            <span class="level-start">
                <span class="level-item">嵌入式</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86/">
            <span class="level-start">
                <span class="level-item">编译原理</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">3</span>
            </span>
        </a></li></ul></li><li>
        <a class="level is-marginless" href="/categories/%E9%9A%8F%E7%AC%94/">
            <span class="level-start">
                <span class="level-item">随笔</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a></li>
            </ul>
        </div>
    </div>
</div>
        
            <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            归档
        </h3>
        <ul class="menu-list">
        
        <li>
            <a class="level is-marginless" href="/archives/2020/10/">
                <span class="level-start">
                    <span class="level-item">十月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/05/">
                <span class="level-start">
                    <span class="level-item">五月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/04/">
                <span class="level-start">
                    <span class="level-item">四月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">5</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/03/">
                <span class="level-start">
                    <span class="level-item">三月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">18</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/11/">
                <span class="level-start">
                    <span class="level-item">十一月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">5</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/10/">
                <span class="level-start">
                    <span class="level-item">十月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/09/">
                <span class="level-start">
                    <span class="level-item">九月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/08/">
                <span class="level-start">
                    <span class="level-item">八月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">4</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/06/">
                <span class="level-start">
                    <span class="level-item">六月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/04/">
                <span class="level-start">
                    <span class="level-item">四月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/03/">
                <span class="level-start">
                    <span class="level-item">三月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">4</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/02/">
                <span class="level-start">
                    <span class="level-item">二月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">4</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/12/">
                <span class="level-start">
                    <span class="level-item">十二月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/11/">
                <span class="level-start">
                    <span class="level-item">十一月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">5</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/10/">
                <span class="level-start">
                    <span class="level-item">十月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">9</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/05/">
                <span class="level-start">
                    <span class="level-item">五月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/04/">
                <span class="level-start">
                    <span class="level-item">四月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/03/">
                <span class="level-start">
                    <span class="level-item">三月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/02/">
                <span class="level-start">
                    <span class="level-item">二月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        </ul>
        </div>
    </div>
</div>
        
            <div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                标签
            </h3>
            <div class="field is-grouped is-grouped-multiline">
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/AX-12/">
                        <span class="tag">AX-12</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Android/">
                        <span class="tag">Android</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Bluetooth/">
                        <span class="tag">Bluetooth</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/C/">
                        <span class="tag">C++</span>
                        <span class="tag is-grey">15</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/CSI%E6%91%84%E5%83%8F%E5%A4%B4/">
                        <span class="tag">CSI摄像头</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/CSS/">
                        <span class="tag">CSS</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/CV/">
                        <span class="tag">CV</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Choregraphe/">
                        <span class="tag">Choregraphe</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/DCMTK/">
                        <span class="tag">DCMTK</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Docker/">
                        <span class="tag">Docker</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/HTML/">
                        <span class="tag">HTML</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Handle/">
                        <span class="tag">Handle</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Hexo/">
                        <span class="tag">Hexo</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/IDEA/">
                        <span class="tag">IDEA</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Java/">
                        <span class="tag">Java</span>
                        <span class="tag is-grey">6</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/JavaScript/">
                        <span class="tag">JavaScript</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Linux/">
                        <span class="tag">Linux</span>
                        <span class="tag is-grey">5</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Mysql/">
                        <span class="tag">Mysql</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/NAO/">
                        <span class="tag">NAO</span>
                        <span class="tag is-grey">6</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/NAO%E6%9C%BA%E5%99%A8%E4%BA%BA/">
                        <span class="tag">NAO机器人</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Nao/">
                        <span class="tag">Nao</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/OpenCV/">
                        <span class="tag">OpenCV</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Python/">
                        <span class="tag">Python</span>
                        <span class="tag is-grey">8</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Python-Pip/">
                        <span class="tag">Python - Pip</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Qt/">
                        <span class="tag">Qt</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Raspberry-Pi-3b/">
                        <span class="tag">Raspberry Pi 3b</span>
                        <span class="tag is-grey">5</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/SDK/">
                        <span class="tag">SDK</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/SVM/">
                        <span class="tag">SVM</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Shell/">
                        <span class="tag">Shell</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Tensorflow/">
                        <span class="tag">Tensorflow</span>
                        <span class="tag is-grey">3</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Tomcat/">
                        <span class="tag">Tomcat</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Unix/">
                        <span class="tag">Unix</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/VSCode/">
                        <span class="tag">VSCode</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/WordPress/">
                        <span class="tag">WordPress</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/python/">
                        <span class="tag">python</span>
                        <span class="tag is-grey">8</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/ssh/">
                        <span class="tag">ssh</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E4%BB%A3%E7%A0%81%E5%AD%98%E6%A1%A3/">
                        <span class="tag">代码存档</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%8C%BB%E5%AD%A6%E5%9B%BE%E5%83%8F/">
                        <span class="tag">医学图像</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%A4%A7%E6%95%B0%E6%8D%AE/">
                        <span class="tag">大数据</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%B5%8C%E5%85%A5%E5%BC%8F-STM32/">
                        <span class="tag">嵌入式 - STM32</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%8B%A6%E6%88%AA%E5%99%A8/">
                        <span class="tag">拦截器</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%95%99%E7%A8%8B/">
                        <span class="tag">教程</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%89%B9%E5%BE%81%E5%B7%A5%E7%A8%8B/">
                        <span class="tag">特征工程</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%AC%AC%E4%B8%89%E6%96%B9%E5%BA%93/">
                        <span class="tag">第三方库</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%BA%A2%E7%90%83%E6%A3%80%E6%B5%8B/">
                        <span class="tag">红球检测</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86/">
                        <span class="tag">编译原理</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/">
                        <span class="tag">解决方案</span>
                        <span class="tag is-grey">6</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E9%9A%8F%E7%AC%94/">
                        <span class="tag">随笔</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
            </div>
        </div>
    </div>
</div>
        
        </div>
    
</div>

                




<div class="column is-4-tablet is-4-desktop is-3-widescreen is-hidden-touch is-hidden-desktop-only has-order-3 column-right ">
    
        
<div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                分类
            </h3>
            <ul class="menu-list">
            <li>
        <a class="level is-marginless" href="/categories/%E5%85%AC%E5%91%8A/">
            <span class="level-start">
                <span class="level-item">公告</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/">
            <span class="level-start">
                <span class="level-item">技术分享</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">58</span>
            </span>
        </a><ul><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Android/">
            <span class="level-start">
                <span class="level-item">Android</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/C/">
            <span class="level-start">
                <span class="level-item">C++</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">14</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Docker/">
            <span class="level-start">
                <span class="level-item">Docker</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Java/">
            <span class="level-start">
                <span class="level-item">Java</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">6</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Linux/">
            <span class="level-start">
                <span class="level-item">Linux</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">3</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/NAO/">
            <span class="level-start">
                <span class="level-item">NAO</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">7</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Python/">
            <span class="level-start">
                <span class="level-item">Python</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E5%89%8D%E7%AB%AF/">
            <span class="level-start">
                <span class="level-item">前端</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E5%8C%BB%E5%AD%A6%E5%9B%BE%E5%83%8F/">
            <span class="level-start">
                <span class="level-item">医学图像</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">2</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">
            <span class="level-start">
                <span class="level-item">机器学习</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E6%A0%91%E8%8E%93%E6%B4%BE/">
            <span class="level-start">
                <span class="level-item">树莓派</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li></ul></li><li>
        <a class="level is-marginless" href="/categories/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/">
            <span class="level-start">
                <span class="level-item">课程设计</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a><ul><li>
        <a class="level is-marginless" href="/categories/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/%E5%B5%8C%E5%85%A5%E5%BC%8F/">
            <span class="level-start">
                <span class="level-item">嵌入式</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86/">
            <span class="level-start">
                <span class="level-item">编译原理</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">3</span>
            </span>
        </a></li></ul></li><li>
        <a class="level is-marginless" href="/categories/%E9%9A%8F%E7%AC%94/">
            <span class="level-start">
                <span class="level-item">随笔</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a></li>
            </ul>
        </div>
    </div>
</div>
    
        <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            归档
        </h3>
        <ul class="menu-list">
        
        <li>
            <a class="level is-marginless" href="/archives/2020/10/">
                <span class="level-start">
                    <span class="level-item">十月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/05/">
                <span class="level-start">
                    <span class="level-item">五月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/04/">
                <span class="level-start">
                    <span class="level-item">四月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">5</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/03/">
                <span class="level-start">
                    <span class="level-item">三月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">18</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/11/">
                <span class="level-start">
                    <span class="level-item">十一月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">5</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/10/">
                <span class="level-start">
                    <span class="level-item">十月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/09/">
                <span class="level-start">
                    <span class="level-item">九月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/08/">
                <span class="level-start">
                    <span class="level-item">八月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">4</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/06/">
                <span class="level-start">
                    <span class="level-item">六月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/04/">
                <span class="level-start">
                    <span class="level-item">四月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/03/">
                <span class="level-start">
                    <span class="level-item">三月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">4</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/02/">
                <span class="level-start">
                    <span class="level-item">二月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">4</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/12/">
                <span class="level-start">
                    <span class="level-item">十二月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/11/">
                <span class="level-start">
                    <span class="level-item">十一月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">5</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/10/">
                <span class="level-start">
                    <span class="level-item">十月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">9</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/05/">
                <span class="level-start">
                    <span class="level-item">五月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/04/">
                <span class="level-start">
                    <span class="level-item">四月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/03/">
                <span class="level-start">
                    <span class="level-item">三月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/02/">
                <span class="level-start">
                    <span class="level-item">二月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        </ul>
        </div>
    </div>
</div>
    
        <div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                标签
            </h3>
            <div class="field is-grouped is-grouped-multiline">
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/AX-12/">
                        <span class="tag">AX-12</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Android/">
                        <span class="tag">Android</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Bluetooth/">
                        <span class="tag">Bluetooth</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/C/">
                        <span class="tag">C++</span>
                        <span class="tag is-grey">15</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/CSI%E6%91%84%E5%83%8F%E5%A4%B4/">
                        <span class="tag">CSI摄像头</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/CSS/">
                        <span class="tag">CSS</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/CV/">
                        <span class="tag">CV</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Choregraphe/">
                        <span class="tag">Choregraphe</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/DCMTK/">
                        <span class="tag">DCMTK</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Docker/">
                        <span class="tag">Docker</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/HTML/">
                        <span class="tag">HTML</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Handle/">
                        <span class="tag">Handle</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Hexo/">
                        <span class="tag">Hexo</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/IDEA/">
                        <span class="tag">IDEA</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Java/">
                        <span class="tag">Java</span>
                        <span class="tag is-grey">6</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/JavaScript/">
                        <span class="tag">JavaScript</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Linux/">
                        <span class="tag">Linux</span>
                        <span class="tag is-grey">5</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Mysql/">
                        <span class="tag">Mysql</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/NAO/">
                        <span class="tag">NAO</span>
                        <span class="tag is-grey">6</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/NAO%E6%9C%BA%E5%99%A8%E4%BA%BA/">
                        <span class="tag">NAO机器人</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Nao/">
                        <span class="tag">Nao</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/OpenCV/">
                        <span class="tag">OpenCV</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Python/">
                        <span class="tag">Python</span>
                        <span class="tag is-grey">8</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Python-Pip/">
                        <span class="tag">Python - Pip</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Qt/">
                        <span class="tag">Qt</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Raspberry-Pi-3b/">
                        <span class="tag">Raspberry Pi 3b</span>
                        <span class="tag is-grey">5</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/SDK/">
                        <span class="tag">SDK</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/SVM/">
                        <span class="tag">SVM</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Shell/">
                        <span class="tag">Shell</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Tensorflow/">
                        <span class="tag">Tensorflow</span>
                        <span class="tag is-grey">3</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Tomcat/">
                        <span class="tag">Tomcat</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Unix/">
                        <span class="tag">Unix</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/VSCode/">
                        <span class="tag">VSCode</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/WordPress/">
                        <span class="tag">WordPress</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/python/">
                        <span class="tag">python</span>
                        <span class="tag is-grey">8</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/ssh/">
                        <span class="tag">ssh</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E4%BB%A3%E7%A0%81%E5%AD%98%E6%A1%A3/">
                        <span class="tag">代码存档</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%8C%BB%E5%AD%A6%E5%9B%BE%E5%83%8F/">
                        <span class="tag">医学图像</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%A4%A7%E6%95%B0%E6%8D%AE/">
                        <span class="tag">大数据</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%B5%8C%E5%85%A5%E5%BC%8F-STM32/">
                        <span class="tag">嵌入式 - STM32</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%8B%A6%E6%88%AA%E5%99%A8/">
                        <span class="tag">拦截器</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%95%99%E7%A8%8B/">
                        <span class="tag">教程</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%89%B9%E5%BE%81%E5%B7%A5%E7%A8%8B/">
                        <span class="tag">特征工程</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%AC%AC%E4%B8%89%E6%96%B9%E5%BA%93/">
                        <span class="tag">第三方库</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%BA%A2%E7%90%83%E6%A3%80%E6%B5%8B/">
                        <span class="tag">红球检测</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86/">
                        <span class="tag">编译原理</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/">
                        <span class="tag">解决方案</span>
                        <span class="tag is-grey">6</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E9%9A%8F%E7%AC%94/">
                        <span class="tag">随笔</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
            </div>
        </div>
    </div>
</div>
    
    
</div>

            </div>
        </div>
    </section>
    <!--
 * @Descripttion: 
 * @version: 
 * @Author: 王政乔(https://www.zhengqiao.wang/)
 * @Date: 2020-03-25 10:59:52
 * @LastEditors: 王政乔(https://www.zhengqiao.wang/)
 * @LastEditTime: 2020-03-26 10:51:19
 -->
<footer class="footer">

    <div class="container">
        <div class="level">
            <div class="level-start has-text-centered-mobile">
                <a class="footer-logo is-block has-mb-6" href="/">
                
                    王政乔|中国
                
                </a>
                <p class="is-size-7">
                <a href='http://www.beian.miit.gov.cn/' >豫ICP备18045451号-1</a>&nbsp;
                &copy; 2020 王政乔&nbsp;
                Powered by <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a> & <a
                        href="https://github.com/ppoffice/hexo-theme-icarus" target="_blank" rel="noopener">Icarus</a>
                        
                
                </p>
            </div>
            <div class="level-end">
            
                <div class="field has-addons is-flex-center-mobile has-mt-5-mobile is-flex-wrap is-flex-middle">
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" rel="noopener" title="访问我的Gitee" href="https://gitee.com/JogerQiao">
                        
                        <i class="iconfont icon-gitee-fill-round"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" rel="noopener" title="我的邮箱" href="mailto:me@zhengqiao.wang">
                        
                        <i class="iconfont icon-mail"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" rel="noopener" title="Bilibili" href="https://space.bilibili.com/83542572">
                        
                        <i class="iconfont icon-bilibili-line"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" rel="noopener" title="知乎" href="https://www.zhihu.com/people/joger-81">
                        
                        <i class="iconfont icon-zhihu"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" rel="noopener" title="SZ" href="http://jun.zhengqiao.wang/">
                        
                        <i class="iconfont icon-setting"></i>
                        
                    </a>
                </p>
                
                </div>
            
            </div>
        </div>
    </div>
    <script>
        (function () {
            var bp = document.createElement('script');
            var curProtocol = window.location.protocol.split(':')[0];
            if (curProtocol === 'https') {
                bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
            }
            else {
                bp.src = 'http://push.zhanzhang.baidu.com/push.js';
            }
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(bp, s);
        })();
    </script>

</footer>
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/moment@2.22.2/min/moment-with-locales.min.js"></script>
<script>moment.locale("zh-CN");</script>


<script>
var IcarusThemeSettings = {
    site: {
        url: 'https://www.zhengqiao.wang',
        external_link: {"enable":true,"exclude":[]}
    },
    article: {
        highlight: {
            clipboard: true,
            fold: 'unfolded'
        }
    }
};
</script>


<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.4/dist/clipboard.min.js" defer></script>





<script src="/js/animation.js"></script>



<script src="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/js/lightgallery.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js" defer></script>
<script src="/js/gallery.js" defer></script>



<div id="outdated">
    <h6>Your browser is out-of-date!</h6>
    <p>Update your browser to view this website correctly. <a id="btnUpdateBrowser" href="http://outdatedbrowser.com/">Update
            my browser now </a></p>
    <p class="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">&times;</a></p>
</div>
<script src="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.js" defer></script>
<script>
    document.addEventListener("DOMContentLoaded", function () {
        outdatedBrowser({
            bgColor: '#f25648',
            color: '#ffffff',
            lowerThan: 'flex'
        });
    });
</script>


<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.5/unpacked/MathJax.js?config=TeX-MML-AM_CHTML" defer></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
    MathJax.Hub.Config({
        'HTML-CSS': {
            matchFontHeight: false
        },
        SVG: {
            matchFontHeight: false
        },
        CommonHTML: {
            matchFontHeight: false
        },
        tex2jax: {
            inlineMath: [
                ['$','$'],
                ['\\(','\\)']
            ]
        }
    });
});
</script>


<a id="back-to-top" title="回到顶端" href="javascript:;">
    <i class="fas fa-chevron-up"></i>
</a>
<script src="/js/back-to-top.js" defer></script>














<script src="/js/main.js" defer></script>

    
    <div class="searchbox ins-search">
    <div class="searchbox-container ins-search-container">
        <div class="searchbox-input-wrapper">
            <input type="text" class="searchbox-input ins-search-input" placeholder="想要查找什么..." />
            <span class="searchbox-close ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="searchbox-result-wrapper ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
    (function (window) {
        var INSIGHT_CONFIG = {
            TRANSLATION: {
                POSTS: '文章',
                PAGES: '页面',
                CATEGORIES: '分类',
                TAGS: '标签',
                UNTITLED: '(无标题)',
            },
            CONTENT_URL: '/content.json',
        };
        window.INSIGHT_CONFIG = INSIGHT_CONFIG;
    })(window);
</script>
<script src="/js/insight.js" defer></script>
<link rel="stylesheet" href="/css/search.css">
<link rel="stylesheet" href="/css/insight.css">
    
</body>
</html>